Skip to content
This repository has been archived by the owner on Mar 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #41 from proshunsuke/v6
Browse files Browse the repository at this point in the history
タイムアウトするのでもっと短いスパンで実行するようにする
  • Loading branch information
proshunsuke authored Mar 28, 2021
2 parents 5c03aa9 + 454f8a0 commit 54dccb0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/lib/trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import dayjs from 'dayjs';

const TARGET_DATE_KEY = 'target_date';
const TARGET_SITE_NAME_KEY = 'site_name';
export const TERMINATION_MINUTES = 4;
export const TERMINATION_MINUTES = 3;
const TRIGGER_FUNCTION_NAME = 'setSchedule';
const TRIGGER_DURATION: number = 60 * 2000; // 2分後

Expand Down
6 changes: 5 additions & 1 deletion src/oneMonthSchedule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ export default class OneMonthSchedule {
throw e;
}
});
console.info(`${date.format('YYYY年MM月')}分時点のカレンダー作成回数: ${counter.getCreateEventCallCount()}`);
console.info(
`${date.format(
'YYYY年MM月'
)}分時点のカレンダー作成回数: ${counter.getCreateEventCallCount()}`
);
}
}
4 changes: 2 additions & 2 deletions tests/lib/trigger.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ afterAll(() => {

describe('hasExceededTerminationMinutes', (): void => {
it('現在時刻が基準時刻を超えている場合にtrueを返すこと', () => {
const startDate = dayjs('2019-12-09T23:56:00.000Z');
const startDate = dayjs('2019-12-09T23:57:00.000Z');
const result = Trigger.hasExceededTerminationMinutes(startDate);
expect(result).toBeTruthy();
});
it('現在時刻が基準時刻を超えていない場合にfalseを返すこと', () => {
const startDate = dayjs('2019-12-09T23:56:01.000Z');
const startDate = dayjs('2019-12-09T23:57:01.000Z');
const result = Trigger.hasExceededTerminationMinutes(startDate);
expect(result).toBeFalsy();
});
Expand Down

0 comments on commit 54dccb0

Please sign in to comment.