Skip to content

Commit

Permalink
[bots] Fix after #5061 (#5064)
Browse files Browse the repository at this point in the history
#5061
Probably going to do some random cache updates when months switch, but
I'm ok with that
  • Loading branch information
clee2000 authored Apr 5, 2024
1 parent 0d81394 commit 9cad727
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions torchci/lib/bot/rerunGithubInfraErrorWorkflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ const tagPrefix = "rerunGithubInfraFailure/";

function rerunGithubInfraErrorWorkflow(app: Probot): void {
let reruns: Map<string, number> = new Map();
let day = 0;
let week = 0;

// This bot is used to rerun failed workflows on pytorch/pytorch that look
// like https://github.com/pytorch/pytorch/actions/runs/8454565307
app.on("workflow_run.requested", async (ctx) => {
if (day > new Date().getDate()) {
const currentWeek = Math.floor(new Date().getDate() / 7);
if (currentWeek != week) {
// Reset reruns info every week ish
day = new Date().getDate();
week = currentWeek;
reruns = new Map();
}
// Only run this if pytorch/pytorch, failed, is a weird infra error, and is
Expand Down

0 comments on commit 9cad727

Please sign in to comment.