mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-23 21:06:22 +08:00
feat(nbstore): better doc sync logic (#9037)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user