misskey/packages/backend/src/services/chart/charts/test-unique.ts

31 lines
638 B
TypeScript

import autobind from 'autobind-decorator';
import Chart, { KVs } from '../core';
import { name, schema } from './entities/test-unique';
/**
* For testing
*/
// eslint-disable-next-line import/no-default-export
export default class TestUniqueChart extends Chart<typeof schema> {
constructor() {
super(name, schema);
}
@autobind
protected async tickMajor(): Promise<Partial<KVs<typeof schema>>> {
return {};
}
@autobind
protected async tickMinor(): Promise<Partial<KVs<typeof schema>>> {
return {};
}
@autobind
public async uniqueIncrement(key: string): Promise<void> {
await this.commit({
foo: [key],
});
}
}