Projektarten: T16 Versuchszähler je Mail (R7)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b8a530958f
commit
de4b6f3a35
2 files changed
+20
-2
No files matched your search
@@ -33,6 +33,7 @@ export function shouldSendAssignMail(project, repo, { now = new Date(), createdN
|
||||
/** Erinnerung faellig: Mail ging vor >= 24 h, Art fehlt noch, noch keine Erinnerung. */
|
||||
export function dueReminder(project, { now = new Date() } = {}) {
|
||||
if (project?.kind || project?.assignReminderSentAt) return false
|
||||
if (Number(project?.assignMailAttempts || 0) >= MAX_ATTEMPTS) return false
|
||||
const sent = time(project?.assignMailSentAt)
|
||||
if (sent === null) return false
|
||||
return new Date(now).getTime() - sent >= DAY_MS
|
||||
@@ -73,6 +74,8 @@ export async function sendRepoAssignMail(project, { giteaLogin, reminder = false
|
||||
await updateDocument(config.collections.websiteProjects, project.$id, patch)
|
||||
return { sent: false, reason: err.message }
|
||||
}
|
||||
// assignMailAttempts zaehlt die Versuche der aktuellen Mail: nach Erfolg zurueck auf 0 (R7)
|
||||
patch.assignMailAttempts = 0
|
||||
patch[reminder ? 'assignReminderSentAt' : 'assignMailSentAt'] = new Date().toISOString()
|
||||
await updateDocument(config.collections.websiteProjects, project.$id, patch)
|
||||
return { sent: true }
|
||||
|
||||
Reference in new issue
Block a user