From 4a7fc4ea697b238098145cad20b21dee7c04bbd3 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Thu, 29 Mar 2018 19:21:44 -0500 Subject: [PATCH] Fix refresh time --- src/helpers.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers.cr b/src/helpers.cr index fca6bb90..33035d60 100644 --- a/src/helpers.cr +++ b/src/helpers.cr @@ -207,7 +207,7 @@ def get_video(id, client, db, refresh = true) video = db.query_one("SELECT * FROM videos WHERE id = $1", id, as: Video) # If record was last updated over an hour ago, refresh (expire param in response lasts for 6 hours) - if refresh && Time.now - video.updated > 1.second + if refresh && Time.now - video.updated > 1.hour begin video = fetch_video(id, client) video_array = video.to_a