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 | |
| parent | cb3b67e54ac135376807486c808dfa2b830e38ff (diff) | |
more TODO ideas etc
| -rw-r--r-- | internal/queue/queue.go | 11 | ||||
| -rw-r--r-- | internal/run.go | 2 |
2 files changed, 8 insertions, 5 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 } } diff --git a/internal/run.go b/internal/run.go index ed70511..3689667 100644 --- a/internal/run.go +++ b/internal/run.go @@ -46,7 +46,7 @@ func runPlatform(ctx context.Context, args config.Args, platform string, sizeLim return err } - log.Println("Scheduling", ent) + log.Println("Posting", ent) var postCB func(context.Context, config.Args, int, entry.Entry) error switch strings.ToLower(platform) { case "mastodon": |
