Add concurrency limit to service

This commit is contained in:
Andras Schmelczer 2024-12-18 20:37:54 +00:00
commit eb87de8e68
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C

View file

@ -1,14 +1,18 @@
import { Database } from "src/database/database";
import { RelativePath } from "src/database/document-metadata";
import { Logger } from "src/logger";
import { SyncServer } from "src/services/sync_service";
import { SyncService } from "src/services/sync_service";
import { unlockDocument, waitForDocumentLock } from "./locks";
export async function syncLocallyDeletedFile(
database: Database,
syncServer: SyncServer,
relativePath: RelativePath
): Promise<void> {
export async function syncLocallyDeletedFile({
database,
syncServer,
relativePath,
}: {
database: Database;
syncServer: SyncService;
relativePath: RelativePath;
}): Promise<void> {
await waitForDocumentLock(relativePath);
try {