Skip to content

Commit

Permalink
feat: log sleeps
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Berezovskyi <andriib@kth.se>
  • Loading branch information
berezovskyi committed Jul 17, 2023
1 parent d533842 commit a7c6ae6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion publisher.zig
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,9 @@ fn commitAndPushRepoChange(log_repo_path: []const u8) !void {
fn pushRepoChange(log_repo_path: []const u8) !void {
try runNoCapture(log_repo_path, &[_][]const u8 {"git", "push", "origin", "HEAD:live", "--force-with-lease"});
// don't push to GH more frequently than once in 15 minutes
std.time.sleep(@as(u64, 15 * 60) * std.time.ns_per_s);
const sleep_min = 15;
std.log.info("Sleeping for {} min between pushes", .{sleep_min});
std.time.sleep(@as(u64, sleep_min * 60) * std.time.ns_per_s);
}

fn formatRepoLogFilename(buf: []u8, year_day: epoch.YearAndDay, month_day: epoch.MonthAndDay) usize {
Expand Down

0 comments on commit a7c6ae6

Please sign in to comment.