╭ changed ────╮ │src/serve.zig│ ╰─────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────╮ │ 8 const serve_ssh = @import("./serve_ssh.zig"); │ │ 9 const serve_http = @import("./serve_http.zig"); │ │10 const evt = @import("./event.zig"); │ │11 +const notify = @import("./notify.zig"); │ │12 │ │13 pub const Options = struct { │ │14 http_listen: ?[]const u8 = "127.0.0.1:8080",│ ╰────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────╮ │82 }; │ │83 defer admin_repo.deinit(io, allocator); │ │84 } │ │85 + │ │86 + // the repos the notify worker has yet to look at │ │87 + var dirty_repos: notify.DirtyRepos = .{ .allocator = allocator };│ │88 + defer dirty_repos.deinit(); │ │89 │ │90 // create http listener │ │91 │ ╰─────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │119 .host_key = try serve_ssh_protocol.HostKey.loadOrGenerate(io, allocator, data_dir_path),│ │120 .session_handler = .{ │ │121 .admin_repo_path = admin_repo_path, │ │117 - .users_dir = users_dir, │ │122 + .server = .{ .users_dir = users_dir, .dirty_repos = &dirty_repos }, │ │123 .wui_port = wui_server.socket.address.getPort(), │ │124 .git_http_port = git_http_port, │ │125 .git_ssh_port = ssh_port, │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │134 │ │135 var tasks: std.Io.Group = .init; │ │136 defer tasks.cancel(io); │ │137 + │ │138 + tasks.concurrent(io, notify.run, .{ &dirty_repos, io, allocator, users_dir, admin_repo_path }) catch |spawn_err| {│ │139 + serve_common.logError(io, err, "notify worker spawn failed: {s}\n", .{@errorName(spawn_err)}); │ │140 + }; │ │141 │ │142 // run listeners, printing the ports actually bound │ │143 │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────╮ │161 runWebListener(io, allocator, &wui_server, &tasks, .{ .server = .{│ │162 .admin_repo_path = admin_repo_path, │ │163 .users_dir = users_dir, │ │164 + .dirty_repos = &dirty_repos, │ │165 .session_store = session_store, │ │166 .git_http_port = git_http_port, │ │167 .git_ssh_port = git_ssh_port, │ ╰───────────────────────────────────────────────────────────────────────────╯