feat(nbstore): better doc sync logic (#9037)

This commit is contained in:
EYHN
2024-12-10 06:49:21 +00:00
parent 0a7a2c3083
commit 35edf389b5
10 changed files with 305 additions and 99 deletions
@@ -101,6 +101,13 @@ export interface DocStorageSchema extends DBSchema {
peer: string;
};
};
locks: {
key: string;
value: {
key: string;
lock: Date;
};
};
}
const migrate: OpenDBCallbacks<DocStorageSchema>['upgrade'] = (
@@ -162,6 +169,11 @@ const init: Migrate = db => {
keyPath: 'key',
autoIncrement: false,
});
db.createObjectStore('locks', {
keyPath: 'key',
autoIncrement: false,
});
};
// END REGION