Commit ffb6d10

Eric Bower  ·  2026-05-08 10:23:54 -0400 EDT
parent 1450d68
chore: dont resync if published.json exists
1 files changed,  +10, -2
+10, -2
......@@ -1487,7 +1487,15 @@ func syncArtifacts(cfg *Cfg, log *slog.Logger) error {
14871487 if !repoEntry.IsDir() {
14881488 continue
14891489 }
1490- eventPath := filepath.Join(cfg.ArtifactDir, entry.Name(), repoEntry.Name(), "event.json")
1490+ jobDir := filepath.Join(cfg.ArtifactDir, entry.Name(), repoEntry.Name())
1491+ eventPath := filepath.Join(jobDir, "event.json")
1492+ publishedPath := filepath.Join(jobDir, "published.json")
1493+
1494+ // Skip if already published (job is complete)
1495+ if _, err := os.Stat(publishedPath); err == nil {
1496+ continue
1497+ }
1498+
14911499 data, err := os.ReadFile(eventPath)
14921500 if err != nil {
14931501 continue // no event yet, skip
......@@ -1505,7 +1513,7 @@ func syncArtifacts(cfg *Cfg, log *slog.Logger) error {
15051513 }
15061514 sshArgs = fmt.Sprintf("-F ~/.ssh/config -i %s%s", cfg.KeyLocation, certFile)
15071515 }
1508- srcDir := filepath.Join(cfg.ArtifactDir, entry.Name(), repoEntry.Name())
1516+ srcDir := jobDir
15091517 // Append "/" so rsync copies into the destination directory,
15101518 // not as a subdirectory named after the source.
15111519 dest := event.ArtifactDest