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
M main.go
+10, -2
 1@@ -1487,7 +1487,15 @@ func syncArtifacts(cfg *Cfg, log *slog.Logger) error {
 2 			if !repoEntry.IsDir() {
 3 				continue
 4 			}
 5-			eventPath := filepath.Join(cfg.ArtifactDir, entry.Name(), repoEntry.Name(), "event.json")
 6+			jobDir := filepath.Join(cfg.ArtifactDir, entry.Name(), repoEntry.Name())
 7+			eventPath := filepath.Join(jobDir, "event.json")
 8+			publishedPath := filepath.Join(jobDir, "published.json")
 9+
10+			// Skip if already published (job is complete)
11+			if _, err := os.Stat(publishedPath); err == nil {
12+				continue
13+			}
14+
15 			data, err := os.ReadFile(eventPath)
16 			if err != nil {
17 				continue // no event yet, skip
18@@ -1505,7 +1513,7 @@ func syncArtifacts(cfg *Cfg, log *slog.Logger) error {
19 				}
20 				sshArgs = fmt.Sprintf("-F ~/.ssh/config -i %s%s", cfg.KeyLocation, certFile)
21 			}
22-			srcDir := filepath.Join(cfg.ArtifactDir, entry.Name(), repoEntry.Name())
23+			srcDir := jobDir
24 			// Append "/" so rsync copies into the destination directory,
25 			// not as a subdirectory named after the source.
26 			dest := event.ArtifactDest