No need to check lastupdate when updating the archives list.
This commit is contained in:
parent
06cb261613
commit
56ea8a52e0
@ -27,15 +27,11 @@ Redirect =
|
|||||||
return
|
return
|
||||||
|
|
||||||
update: ->
|
update: ->
|
||||||
items =
|
$.get lastarchivecheck, 0, ({lastarchivecheck}) ->
|
||||||
lastarchivecheck: 0
|
|
||||||
lastupdate: 0
|
|
||||||
$.get items, (items) ->
|
|
||||||
now = Date.now()
|
now = Date.now()
|
||||||
# Update the list of archives every 4 days.
|
# Update the list of archives every 4 days.
|
||||||
# The list is also update when 4chan X gets updated.
|
# The list is also update when 4chan X gets updated.
|
||||||
if items.lastupdate > now - 4 * $.DAY or items.lastarchivecheck > now - 4 * $.DAY
|
return if lastarchivecheck > now - 4 * $.DAY
|
||||||
return
|
|
||||||
$.ajax '<%= meta.page %>json/archives.json', onload: ->
|
$.ajax '<%= meta.page %>json/archives.json', onload: ->
|
||||||
return unless @status is 200
|
return unless @status is 200
|
||||||
Conf['archives'] = JSON.parse @response
|
Conf['archives'] = JSON.parse @response
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user