Skip to content

Commit

Permalink
Made changes to allow testing faster locally
Browse files Browse the repository at this point in the history
  • Loading branch information
tkmcmaster committed Dec 27, 2023
1 parent 3ddc5b4 commit 5ad9d8e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion controller/pages/api/util/testscheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import {
import { TestManager, defaultRecurringFileTags } from "./testmanager";
import { formatError, getHourMinuteFromTimestamp } from "./clientutil";
import type { EventInput } from "@fullcalendar/core";
import { IS_RUNNING_IN_AWS } from "./authclient";
import { PpaasEncryptS3File } from "./ppaasencrypts3file";

const { sleep } = util;
Expand Down Expand Up @@ -397,7 +398,7 @@ export class TestScheduler implements TestSchedulerItem {
// Start background task to delete old files
(async () => {
// Don't start right away, delay to sometime within today
let nextLoop: number = Date.now() + Math.floor(Math.random() * ONE_DAY);
let nextLoop: number = Date.now() + (IS_RUNNING_IN_AWS ? Math.floor(Math.random() * ONE_DAY) : 0);
if (nextLoop > Date.now()) {
const delay = nextLoop - Date.now();
log("Delete Historical Loop: nextLoop: " + new Date(nextLoop), LogLevel.DEBUG, { delay, nextLoop });
Expand Down

0 comments on commit 5ad9d8e

Please sign in to comment.