Zuordnungs-Lauf: vom System-Konto angelegte Projekte nicht alle 10 Minuten abfragen

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Opus 5.5 committed 2026-10-04 13:24:06 +00:00
1 parent e43cdb667b
commit d878df96e0
2 files changed
+14

No files matched your search

+3
View File
@@ -150,6 +150,9 @@ export async function runRepoAssignJob({
const docs = await listDocuments(collection(), [Query.limit(5000)])
for (const p of docs) {
if (!p.createdByGitea || p.kind || p.archived || handled.has(p.$id)) continue
// Vom System-Konto angelegt (WOMS "Neues Projekt"): kein Mitarbeiter, den man erinnern
// koennte - sonst alle 10 Minuten Gitea-Abfrage und Log "keinem Mitarbeiter zugeordnet".
if (String(p.createdByGitea).toLowerCase() === String(config.gitea.systemUser || '').toLowerCase()) continue
// 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 < 3) {
+11
View File
@@ -126,6 +126,17 @@ test('Job: Mail ohne vorherigen Versuch wird nachgeholt (createdByGitea, 0 Versu
assert.equal(sink.sent.length, 1)
})
test('Job: vom System-Konto angelegtes Projekt ohne Art wird nicht abgefragt und nicht gemailt', async () => {
freshSink()
gitea.addRepo({ full_name: 'WEBklar/aus-womS', created_at: ago(1) })
aw.insert('websiteProjects', { repoFullName: 'WEBklar/aus-womS', projectName: 'aus WOMS', createdByGitea: 'webklar-system', assignMailAttempts: 0 })
const before = gitea.calls.filter((c) => c.path === '/api/v1/repos/WEBklar/aus-womS').length
const c = await runRepoAssignJob({ now: NOW })
assert.equal(c.retries, 0)
assert.equal(sink.sent.length, 0)
assert.equal(gitea.calls.filter((x) => x.path === '/api/v1/repos/WEBklar/aus-womS').length, before)
})
test('Job: neues Nutzer-Repo → Mail, Org-Repo → keine Mail', async () => {
freshSink()
gitea.addRepo({ full_name: 'knso/jobneu', created_at: ago(1) })