refactor(backend): use insert instead of save

This commit is contained in:
syuilo
2022-01-26 00:51:26 +09:00
parent 91c56ceb6e
commit 37a4e5f4fc
6 changed files with 10 additions and 10 deletions

View File

@@ -16,12 +16,12 @@ export async function registerOrFetchInstanceDoc(host: string): Promise<Instance
const index = await Instances.findOne({ host });
if (index == null) {
const i = await Instances.save({
const i = await Instances.insert({
id: genId(),
host,
caughtAt: new Date(),
lastCommunicatedAt: new Date(),
});
}).then(x => Instances.findOneOrFail(x.identifiers[0]));
federationChart.update(true);