search for standard sites pub-search.waow.tech
search zig blog atproto
11
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: separate turso clients for sync and search

sync and search were sharing one turso client with a mutex, so sync
batch fetches blocked search queries. now sync has its own client —
search queries go through independently even during full sync.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

zzstoatzz 256a1331 31eefcab

+4 -2
+4 -2
backend/src/db/mod.zig
··· 15 15 // global state 16 16 var gpa: std.heap.GeneralPurposeAllocator(.{}) = .{}; 17 17 var client: ?Client = null; 18 + var sync_client: ?Client = null; 18 19 var local_db: ?LocalDb = null; 19 20 20 21 /// Initialize Turso client only (fast, call synchronously at startup) 21 22 pub fn initTurso() !void { 22 23 client = try Client.init(gpa.allocator()); 24 + sync_client = try Client.init(gpa.allocator()); 23 25 try schema.init(&client.?); 24 26 } 25 27 ··· 64 66 65 67 /// Start background sync thread (call from main after db.init) 66 68 pub fn startSync() void { 67 - const c = getClient() orelse { 68 - std.debug.print("sync: no turso client, skipping\n", .{}); 69 + const c = if (sync_client) |*sc| sc else { 70 + std.debug.print("sync: no sync client, skipping\n", .{}); 69 71 return; 70 72 }; 71 73 const local = getLocalDbRaw() orelse {