enhance: improve federation chart

This commit is contained in:
syuilo
2022-02-10 17:45:12 +09:00
parent 7ba5512a65
commit 0afebcfd9e
25 changed files with 199 additions and 64 deletions

View File

@@ -15,7 +15,7 @@ export default class NotesChart extends Chart<typeof schema> {
}
@autobind
protected async queryCurrentState(): Promise<Partial<KVs<typeof schema>>> {
protected async tickMajor(): Promise<Partial<KVs<typeof schema>>> {
const [localCount, remoteCount] = await Promise.all([
Notes.count({ userHost: null }),
Notes.count({ userHost: Not(IsNull()) }),
@@ -27,6 +27,11 @@ export default class NotesChart extends Chart<typeof schema> {
};
}
@autobind
protected async tickMinor(): Promise<Partial<KVs<typeof schema>>> {
return {};
}
@autobind
public async update(note: Note, isAdditional: boolean): Promise<void> {
const prefix = note.userHost === null ? 'local' : 'remote';