mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: make OCR portable and reliable across AMD64 and ARM64 (#519)
* fix: make OCR portable and reliable * fix: harden OCR installation portability * fix: pin OCR partials across downloads * fix: make OCR execution reliably asynchronous * fix: harden OCR portability and docs routes * fix: preserve decoder and docs safeguards
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { readFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
const source = readFileSync(join(process.cwd(), "apps/api/src/index.ts"), "utf8");
|
||||
|
||||
describe("OCR runtime startup reconciliation", () => {
|
||||
it("reconciles pending activation before ordinary startup continues", () => {
|
||||
const start = source.indexOf("ensureAiDirs();");
|
||||
const end = source.indexOf("function parseTrustProxy", start);
|
||||
const startupRecovery = source.slice(start, end);
|
||||
|
||||
expect(start).toBeGreaterThanOrEqual(0);
|
||||
expect(end).toBeGreaterThan(start);
|
||||
expect(startupRecovery).toContain('runOcrRuntimeMaintenance("reconcile"');
|
||||
expect(startupRecovery).not.toContain('runOcrRuntimeMaintenance("gc"');
|
||||
expect(startupRecovery).toMatch(/await\s+initialOcrRuntimeReconciliation/);
|
||||
expect(startupRecovery).toContain("installLockFd");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user