Skip to content

Commit

Permalink
chore: duration can be equal to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyrxng committed Aug 16, 2024
1 parent 55f86c4 commit cfcdfed
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/helpers/update-tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,11 @@ async function updateReminderForIssue(context: Context, repo: ListForOrg["data"]
}
const duration = taskDeadlineMatch[1] || "";
const durationInMs = ms(duration);
if (!durationInMs) {
logger.error(`Invalid duration found on ${issue.url}`);
if (durationInMs === 0) {
// it could mean there was no time label set on the issue
// but it could still be workable and priced
} else if (durationInMs < 0 || !durationInMs) {
logger.error(`Invalid deadline found on ${issue.url}`);
return false;
}
metadata.taskDeadline = DateTime.fromMillis(lastCheck.toMillis() + durationInMs).toISO() || "";
Expand Down

0 comments on commit cfcdfed

Please sign in to comment.