Catch dead servers in archive bookmark job

This commit is contained in:
2024-03-03 19:46:15 +11:00
parent a682f05c3f
commit 413f2e2b3e
3 changed files with 8 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
require "httparty"
require "que"
require "net/http"
module Adamantium
module Jobs
@@ -14,6 +15,8 @@ module Adamantium
if code >= 400
bookmark_repo.update(id: bookmark.id, params: {url: "https://web.archive.org/web/*/#{bookmark.url}"})
end
rescue Net::OpenTimeout
bookmark_repo.update(id: bookmark.id, params: {url: "https://web.archive.org/web/*/#{bookmark.url}"})
end
end
end