A SpaceTraders Agent
0
fork

Configure Feed

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

update to latest zig master

Altagos 05c99f39 b21b823a

+19 -21
+3 -3
build.zig.zon
··· 11 11 .hash = "pretty-0.1.0--Y3D26JKAAABPfRqFy6oUakwiYAawqqbU6xF0_5ziP-l", 12 12 }, 13 13 .zqlite = .{ 14 - .url = "git+https://github.com/karlseguin/zqlite.zig?ref=master#b44ed5cdc64859b08446c246f307e65ebe2b2d9c", 15 - .hash = "zqlite-0.0.0-RWLaY_y_mADh2LdbDrG_2HT2dBAcsAR8Jig_7-dOJd0B", 14 + .url = "git+https://github.com/altagos/zqlite.zig?ref=master#f95c6bc7b182a8c18d8341fba031fa6d5d2ffbd1", 15 + .hash = "zqlite-0.0.1-RWLaY-ybmAD3n26uDYVbLm772-sPi5WsVfxTQmGuZC9B", 16 16 }, 17 17 .sqlite3 = .{ 18 - .url = "https://www.sqlite.org/2026/sqlite-amalgamation-3510200.zip", 18 + .url = "http://www.sqlite.org/2026/sqlite-amalgamation-3510200.zip", 19 19 .hash = "N-V-__8AALNmqgBz73I7J8GlQS_kCPTRgxS0rm8gXcEM8Evk", 20 20 }, 21 21 },
+16 -18
src/st/http.zig
··· 73 73 defer l.mutex.unlock(io); 74 74 75 75 if (l.time) |t| { 76 - const dur = t.durationTo(Io.Clock.now(.real, io) catch return false); 76 + const dur = t.durationTo(Io.Clock.now(.real, io)); 77 77 if (dur.toSeconds() > 0) { 78 78 l.semaphor.set(io, l.points); 79 79 l.time = null; ··· 89 89 defer l.mutex.unlock(io); 90 90 91 91 if (l.time == null) { 92 - const now = try Io.Clock.now(.real, io); 92 + const now = Io.Clock.now(.real, io); 93 93 l.time = now.addDuration(.fromMilliseconds(l.duration)); 94 94 } 95 95 ··· 98 98 99 99 pub fn timeToReset(l: *Limiter, io: Io) Io.Duration { 100 100 if (l.time) |t| { 101 - return t.durationTo(Io.Clock.now(.real, io) catch return .zero); 101 + return t.durationTo(Io.Clock.now(.real, io)); 102 102 } 103 103 return .zero; 104 104 } ··· 329 329 330 330 log.debug("requesting: {s}", .{uri.path.percent_encoded}); 331 331 332 - const start: ?Io.Timestamp = Io.Clock.now(.real, client.io) catch null; 332 + const start = Io.Clock.now(.real, client.io); 333 333 334 334 switch (opts.body) { 335 335 .empty => try req.sendBodiless(), ··· 352 352 353 353 _ = client.total_requests.fetchAdd(1, .seq_cst); 354 354 355 - if (start) |s| blk: { 356 - const latency: u64 = @intCast(s.durationTo(Io.Clock.now(.real, client.io) catch break :blk).toMilliseconds()); 357 - const old_average = client.average_latency.load(.seq_cst); 358 - var new_average: u64 = 0; 355 + const latency: u64 = @intCast(start.durationTo(Io.Clock.now(.real, client.io)).toMilliseconds()); 356 + const old_average = client.average_latency.load(.seq_cst); 357 + var new_average: u64 = 0; 359 358 360 - if (old_average == 0) { 361 - new_average = latency; 362 - } else { 363 - const total_reqs = client.total_requests.load(.seq_cst); 364 - new_average = old_average * (total_reqs - 1) / total_reqs + latency / total_reqs; 365 - } 359 + if (old_average == 0) { 360 + new_average = latency; 361 + } else { 362 + const total_reqs = client.total_requests.load(.seq_cst); 363 + new_average = old_average * (total_reqs - 1) / total_reqs + latency / total_reqs; 364 + } 366 365 367 - client.average_latency.store(new_average, .seq_cst); 368 - _ = client.total_latency.fetchAdd(latency, .seq_cst); 366 + client.average_latency.store(new_average, .seq_cst); 367 + _ = client.total_latency.fetchAdd(latency, .seq_cst); 369 368 370 - log.debug("latency: {} ms - average: {}ms", .{ latency, new_average }); 371 - } 369 + log.debug("latency: {} ms - average: {}ms", .{ latency, new_average }); 372 370 373 371 log.debug( 374 372 "\x1b[2m[path = {s}]\x1b[0m received {s}{d} {s}\x1b[0m",