diff options
author | Jordan <me@jordan.im> | 2021-12-13 22:44:15 -0700 |
---|---|---|
committer | Jordan <me@jordan.im> | 2021-12-13 22:44:15 -0700 |
commit | 0831909bcdbd1421f8c654321017dfd0adafaa9e (patch) | |
tree | ff098bf4e0c0757a1cd859e064176410d519f5d7 | |
parent | a3281e1b5cda3466c83ebba65a0d6e59a25dc105 (diff) | |
download | keep-0831909bcdbd1421f8c654321017dfd0adafaa9e.tar.gz keep-0831909bcdbd1421f8c654321017dfd0adafaa9e.zip |
keep: log skipped/saved archival states
-rw-r--r-- | keep.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -41,7 +41,7 @@ var ( func main() { - // Create ~/.keep directory in user's home to store db + // ~/.keep directory stores db cache and json config user, err := user.Current() if err != nil { log.Fatal(err) @@ -122,14 +122,14 @@ func archiver(db *sql.DB) { archived, status_code := isArchived(message.URL) if archived && status_code == http.StatusOK { addArchived(db, message, status_code) - log.Printf("%d %s", status_code, message.URL) + log.Printf("SKIP %d %s", status_code, message.URL) continue } // Archive, URL is not present in cache or IA status_code = archive(message.URL) addArchived(db, message, status_code) - log.Printf("%d %s", status_code, message.URL) + log.Printf("SAVE %d %s", status_code, message.URL) // Limit requests to Wayback API to 5-second intervals time.Sleep(5 * time.Second) |