diff options
| author | Paul Buetow <paul@buetow.org> | 2024-10-18 11:39:44 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2024-10-18 11:39:44 +0300 |
| commit | fb6d68ca8320d6613c5d23cf60664995d7d6abb2 (patch) | |
| tree | 746826ec723ee40c294c6dd61e661cf79410f789 /internal/queue/queue.go | |
| parent | cb3b67e54ac135376807486c808dfa2b830e38ff (diff) | |
more TODO ideas etc
Diffstat (limited to 'internal/queue/queue.go')
| -rw-r--r-- | internal/queue/queue.go | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/internal/queue/queue.go b/internal/queue/queue.go index 0724f7b..9cc22d8 100644 --- a/internal/queue/queue.go +++ b/internal/queue/queue.go @@ -81,12 +81,15 @@ func queuePlatforms(args config.Args) error { if args.DryRun { continue } - archivePath := filepath.Join(args.GosDir, "db", "archive", filepath.Base(filePath)) - log.Printf("Archiving %s -> %s", filePath, archivePath) - if err := oi.EnsureParentDir(archivePath); err != nil { + + // Keep queued items in trash for a while. + // TODO: clean up files older than 3 months from there + trashPath := filepath.Join(args.GosDir, "db", "trashbin", filepath.Base(filePath)) + log.Printf("Trashing %s -> %s", filePath, trashPath) + if err := oi.EnsureParentDir(trashPath); err != nil { return err } - if err := os.Rename(filePath, archivePath); err != nil { + if err := os.Rename(filePath, trashPath); err != nil { return err } } |
