Fix bookmark caching
This commit is contained in:
@@ -12,7 +12,7 @@ module Adamantium
|
|||||||
bookmarks.each do |bookmark|
|
bookmarks.each do |bookmark|
|
||||||
code = HTTParty.get(bookmark.url, follow_redirects: false).code
|
code = HTTParty.get(bookmark.url, follow_redirects: false).code
|
||||||
if code >= 400
|
if code >= 400
|
||||||
bookmark_repo.update(bookmark.id, {url: "https://web.archive.org/web/*/#{bookmark.url}"})
|
bookmark_repo.update(bookmark.id, params: {url: "https://web.archive.org/web/*/#{bookmark.url}"})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@@ -9,7 +9,7 @@ module Admin
|
|||||||
bookmark = bookmark_repo.fetch(id: bookmark_id)
|
bookmark = bookmark_repo.fetch(id: bookmark_id)
|
||||||
|
|
||||||
page_cacher.call(url: bookmark.url) do |content|
|
page_cacher.call(url: bookmark.url) do |content|
|
||||||
bookmark_repo.update(id: bookmark_id, cached_content: content)
|
bookmark_repo.update(id: bookmark_id, params: { cached_content: content })
|
||||||
end
|
end
|
||||||
|
|
||||||
Success()
|
Success()
|
||||||
|
@@ -31,8 +31,8 @@ module Admin
|
|||||||
posts.where(id: id).update(published_at: Time.now)
|
posts.where(id: id).update(published_at: Time.now)
|
||||||
end
|
end
|
||||||
|
|
||||||
def update(id:, cached_content:)
|
def update(id:, params:)
|
||||||
posts.where(id: id).update(cached_content: cached_content)
|
posts.where(id: id).update(params)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user