mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
feat: jwt performance
This commit is contained in:
@@ -115,8 +115,8 @@ async function _initYjsDatabase(
|
||||
|
||||
const doc = new Doc({ autoLoad: true, shouldLoad: true });
|
||||
|
||||
const idb = await new IndexeddbPersistence(workspace, doc).whenSynced;
|
||||
const [awareness, ws] = await _initWebsocketProvider(
|
||||
const idbp = new IndexeddbPersistence(workspace, doc).whenSynced;
|
||||
const wsp = _initWebsocketProvider(
|
||||
backend,
|
||||
workspace,
|
||||
doc,
|
||||
@@ -124,6 +124,8 @@ async function _initYjsDatabase(
|
||||
params
|
||||
);
|
||||
|
||||
const [idb, [awareness, ws]] = await Promise.all([idbp, wsp]);
|
||||
|
||||
const binaries = new Doc({ autoLoad: true, shouldLoad: true });
|
||||
const binariesIdb = await new IndexeddbPersistence(
|
||||
`${workspace}_binaries`,
|
||||
@@ -410,6 +412,7 @@ export class YjsAdapter implements AsyncDatabaseAdapter<YjsContentOperation> {
|
||||
binary?: ArrayBufferLike;
|
||||
}
|
||||
): Promise<YjsBlockInstance> {
|
||||
console.trace('createBlock', options);
|
||||
const uuid = options.uuid || `affine${nanoid(16)}`;
|
||||
if (options.type === BlockTypes.binary) {
|
||||
if (options.binary && options.binary instanceof ArrayBuffer) {
|
||||
|
||||
@@ -51,7 +51,7 @@ export function isBlock(obj: any) {
|
||||
}
|
||||
|
||||
export function sleep() {
|
||||
return new Promise(resolve => setTimeout(resolve, 500));
|
||||
return new Promise(resolve => setTimeout(resolve, 100));
|
||||
}
|
||||
|
||||
export { BlockEventBus } from './event-bus';
|
||||
|
||||
Reference in New Issue
Block a user