remove ensureindex api (use postInit instead)

This commit is contained in:
undefined committed 2020-07-25 12:18:54 +08:00
1 parent be9d2bffb9
commit e62e7b49a3
13 files changed
+56 -107

No files matched your search

+3 -2
View File
@@ -19,8 +19,9 @@ export async function inc(op: string, ident: string, periodSecs: number, maxOper
}
}
export function ensureIndexes() {
function ensureIndexes() {
return coll.createIndex('expireAt', { expireAfterSeconds: 0 });
}
global.Hydro.model.opcount = { inc, ensureIndexes };
global.Hydro.postInit.push(ensureIndexes);
global.Hydro.model.opcount = { inc };