mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-26 01:28:05 +01:00
Add vacuum command.
// FREEBIE
This commit is contained in:
@@ -85,6 +85,9 @@ public abstract class Accounts {
|
||||
return insertStep(account);
|
||||
}
|
||||
|
||||
@SqlUpdate("VACUUM accounts")
|
||||
public abstract void vacuum();
|
||||
|
||||
public static class AccountMapper implements ResultSetMapper<Account> {
|
||||
@Override
|
||||
public Account map(int i, ResultSet resultSet, StatementContext statementContext)
|
||||
|
||||
@@ -31,8 +31,6 @@ import org.skife.jdbi.v2.sqlobject.Transaction;
|
||||
import org.skife.jdbi.v2.sqlobject.customizers.Mapper;
|
||||
import org.skife.jdbi.v2.tweak.ResultSetMapper;
|
||||
import org.whispersystems.textsecuregcm.entities.PreKeyBase;
|
||||
import org.whispersystems.textsecuregcm.entities.PreKeyV1;
|
||||
import org.whispersystems.textsecuregcm.entities.PreKeyV2;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.annotation.ElementType;
|
||||
@@ -114,6 +112,9 @@ public abstract class Keys {
|
||||
else return Optional.absent();
|
||||
}
|
||||
|
||||
@SqlUpdate("VACUUM keys")
|
||||
public abstract void vacuum();
|
||||
|
||||
@BindingAnnotation(PreKeyBinder.PreKeyBinderFactory.class)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.PARAMETER})
|
||||
|
||||
@@ -31,4 +31,7 @@ public interface PendingAccounts {
|
||||
|
||||
@SqlUpdate("DELETE FROM pending_accounts WHERE number = :number")
|
||||
void remove(@Bind("number") String number);
|
||||
|
||||
@SqlUpdate("VACUUM pending_accounts")
|
||||
public void vacuum();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user