feat(client): add manual digital employee sync

This commit is contained in:
baiyanyun
2026-06-05 18:24:04 +08:00
parent b7aecad092
commit 17475bf0d7
6 changed files with 170 additions and 120 deletions

View File

@@ -97,7 +97,9 @@ export function getDigitalEmployeeSyncStatus(): DigitalEmployeeSyncStatus {
};
}
export async function flushDigitalEmployeeSyncOutbox(options: { force?: boolean } = {}): Promise<DigitalEmployeeSyncStatus> {
export async function flushDigitalEmployeeSyncOutbox(
options: { force?: boolean } = {},
): Promise<DigitalEmployeeSyncStatus> {
if (syncing) return getDigitalEmployeeSyncStatus();
const config = resolveSyncConfig();
@@ -213,7 +215,9 @@ function readAuthToken(serverHost: string | null): string | null {
function readPendingOutbox(limit: number, force: boolean): OutboxRow[] {
const db = getDb();
if (!db) return [];
const candidateLimit = force ? limit : limit * FAILED_RETRY_CANDIDATE_MULTIPLIER;
const candidateLimit = force
? limit
: limit * FAILED_RETRY_CANDIDATE_MULTIPLIER;
const rows = db
.prepare(
`