Projektarten: Zuordnungs-Mail auch ohne vorherigen Versuch nachholen
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1f1ffb5275
commit
d3c6858ecc
2 files changed
+20
-2
No files matched your search
@@ -101,6 +101,9 @@ export async function runRepoAssignJob({
|
||||
if (isOrgOwner(repo)) continue
|
||||
const login = repo.owner?.login || ''
|
||||
if (!login) continue
|
||||
// Alte Repos (>= 24 h) bekommen keinen Ersteller: sie werden nie gemailt und nie erinnert.
|
||||
const age = now.getTime() - new Date(repo.created_at || 0).getTime()
|
||||
if (!(age < 24 * 3600_000)) continue
|
||||
handled.add(projectId)
|
||||
await updateDocument(collection(), projectId, { createdByGitea: login })
|
||||
const r = await sendFirstMailIfDue(projectId, repo, login, { now, createdNow: true, sendMail })
|
||||
@@ -110,9 +113,9 @@ export async function runRepoAssignJob({
|
||||
const docs = await listDocuments(collection(), [Query.limit(5000)])
|
||||
for (const p of docs) {
|
||||
if (!p.createdByGitea || p.kind || handled.has(p.$id)) continue
|
||||
// Wiederholung: erste Mail fehlgeschlagen (1-2 Versuche), Repo noch juenger als 24 h.
|
||||
// Wiederholung/Nachholen: erste Mail noch nicht raus (0-2 Versuche), Repo noch juenger als 24 h.
|
||||
const attempts = Number(p.assignMailAttempts || 0)
|
||||
if (!p.assignMailSentAt && attempts > 0 && attempts < 3) {
|
||||
if (!p.assignMailSentAt && attempts < 3) {
|
||||
let repo
|
||||
try {
|
||||
repo = await fetchRepo(p.repoFullName)
|
||||
|
||||
Reference in new issue
Block a user