No need to check lastupdate when updating the archives list.

This commit is contained in:
Mayhem 2013-05-08 16:04:19 +02:00
parent 06cb261613
commit 56ea8a52e0

View File

@ -27,15 +27,11 @@ Redirect =
return
update: ->
items =
lastarchivecheck: 0
lastupdate: 0
$.get items, (items) ->
$.get lastarchivecheck, 0, ({lastarchivecheck}) ->
now = Date.now()
# Update the list of archives every 4 days.
# The list is also update when 4chan X gets updated.
if items.lastupdate > now - 4 * $.DAY or items.lastarchivecheck > now - 4 * $.DAY
return
return if lastarchivecheck > now - 4 * $.DAY
$.ajax '<%= meta.page %>json/archives.json', onload: ->
return unless @status is 200
Conf['archives'] = JSON.parse @response