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
M
main.go
+10,
-2
| ... | ... | @@ -1487,7 +1487,15 @@ func syncArtifacts(cfg *Cfg, log *slog.Logger) error { | |
| 1487 | 1487 | if !repoEntry.IsDir() { | |
| 1488 | 1488 | continue | |
| 1489 | 1489 | } | |
| 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 | + | ||
| 1491 | 1499 | data, err := os.ReadFile(eventPath) | |
| 1492 | 1500 | if err != nil { | |
| 1493 | 1501 | continue // no event yet, skip |
| ... | ... | @@ -1505,7 +1513,7 @@ func syncArtifacts(cfg *Cfg, log *slog.Logger) error { | |
| 1505 | 1513 | } | |
| 1506 | 1514 | sshArgs = fmt.Sprintf("-F ~/.ssh/config -i %s%s", cfg.KeyLocation, certFile) | |
| 1507 | 1515 | } | |
| 1508 | - | srcDir := filepath.Join(cfg.ArtifactDir, entry.Name(), repoEntry.Name()) | |
| 1516 | + | srcDir := jobDir | |
| 1509 | 1517 | // Append "/" so rsync copies into the destination directory, | |
| 1510 | 1518 | // not as a subdirectory named after the source. | |
| 1511 | 1519 | dest := event.ArtifactDest |