Catch dead servers in archive bookmark job
This commit is contained in:
1
Gemfile
1
Gemfile
@@ -11,6 +11,7 @@ gem "hanami-validations", "2.1.0"
|
|||||||
gem "hanami-assets", "2.1.0"
|
gem "hanami-assets", "2.1.0"
|
||||||
gem "hanami-view", "2.1.0"
|
gem "hanami-view", "2.1.0"
|
||||||
|
|
||||||
|
gem "csv"
|
||||||
gem "rom-sql"
|
gem "rom-sql"
|
||||||
gem "pg"
|
gem "pg"
|
||||||
gem "scraperd", github: "dNitza/scraperd", branch: "master"
|
gem "scraperd", github: "dNitza/scraperd", branch: "master"
|
||||||
|
@@ -68,6 +68,7 @@ GEM
|
|||||||
concurrent-ruby (1.2.3)
|
concurrent-ruby (1.2.3)
|
||||||
connection_pool (2.4.1)
|
connection_pool (2.4.1)
|
||||||
crass (1.0.6)
|
crass (1.0.6)
|
||||||
|
csv (3.2.8)
|
||||||
database_cleaner-core (2.0.1)
|
database_cleaner-core (2.0.1)
|
||||||
database_cleaner-sequel (2.0.2)
|
database_cleaner-sequel (2.0.2)
|
||||||
database_cleaner-core (~> 2.0.0)
|
database_cleaner-core (~> 2.0.0)
|
||||||
@@ -330,7 +331,7 @@ GEM
|
|||||||
parser (3.3.0.5)
|
parser (3.3.0.5)
|
||||||
ast (~> 2.4.1)
|
ast (~> 2.4.1)
|
||||||
racc
|
racc
|
||||||
pg (1.5.5)
|
pg (1.5.6)
|
||||||
pry (0.14.2)
|
pry (0.14.2)
|
||||||
coderay (~> 1.1)
|
coderay (~> 1.1)
|
||||||
method_source (~> 1.0)
|
method_source (~> 1.0)
|
||||||
@@ -441,7 +442,7 @@ GEM
|
|||||||
nokogiri (>= 1.12.0)
|
nokogiri (>= 1.12.0)
|
||||||
sentry-ruby (5.16.1)
|
sentry-ruby (5.16.1)
|
||||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||||
sequel (5.77.0)
|
sequel (5.78.0)
|
||||||
bigdecimal
|
bigdecimal
|
||||||
shellany (0.0.1)
|
shellany (0.0.1)
|
||||||
simple-rss (1.3.3)
|
simple-rss (1.3.3)
|
||||||
@@ -510,6 +511,7 @@ DEPENDENCIES
|
|||||||
capistrano-systemd-multiservice
|
capistrano-systemd-multiservice
|
||||||
capistrano3-puma!
|
capistrano3-puma!
|
||||||
connection_pool
|
connection_pool
|
||||||
|
csv
|
||||||
database_cleaner-sequel
|
database_cleaner-sequel
|
||||||
dotenv
|
dotenv
|
||||||
down
|
down
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
require "httparty"
|
require "httparty"
|
||||||
require "que"
|
require "que"
|
||||||
|
require "net/http"
|
||||||
|
|
||||||
module Adamantium
|
module Adamantium
|
||||||
module Jobs
|
module Jobs
|
||||||
@@ -14,6 +15,8 @@ module Adamantium
|
|||||||
if code >= 400
|
if code >= 400
|
||||||
bookmark_repo.update(id: bookmark.id, params: {url: "https://web.archive.org/web/*/#{bookmark.url}"})
|
bookmark_repo.update(id: bookmark.id, params: {url: "https://web.archive.org/web/*/#{bookmark.url}"})
|
||||||
end
|
end
|
||||||
|
rescue Net::OpenTimeout
|
||||||
|
bookmark_repo.update(id: bookmark.id, params: {url: "https://web.archive.org/web/*/#{bookmark.url}"})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user