diff options
| author | Omar Roth <omarroth@hotmail.com> | 2018-09-09 14:41:29 -0500 |
|---|---|---|
| committer | Omar Roth <omarroth@hotmail.com> | 2018-09-09 14:41:29 -0500 |
| commit | ffab3ee79f0c7661aeb8e8c99fdea02d71a45ce4 (patch) | |
| tree | ea17eb75bbc7581cb187dbab2c01faf92170480f /src | |
| parent | dc6cc028c55953ee0f194c963eb7c4c0174d366f (diff) | |
| download | invidious-ffab3ee79f0c7661aeb8e8c99fdea02d71a45ce4.tar.gz invidious-ffab3ee79f0c7661aeb8e8c99fdea02d71a45ce4.tar.bz2 invidious-ffab3ee79f0c7661aeb8e8c99fdea02d71a45ce4.zip | |
Shrink size between video requests
Diffstat (limited to 'src')
| -rw-r--r-- | src/invidious/videos.cr | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/invidious/videos.cr b/src/invidious/videos.cr index be7c560f..f81488c1 100644 --- a/src/invidious/videos.cr +++ b/src/invidious/videos.cr @@ -367,8 +367,8 @@ def get_video(id, db, refresh = true) if db.query_one?("SELECT EXISTS (SELECT true FROM videos WHERE id = $1)", id, as: Bool) 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.hour + # If record was last updated over 10 minutes ago, refresh (expire param in response lasts for 6 hours) + if refresh && Time.now - video.updated > 10.minutes begin video = fetch_video(id) video_array = video.to_a |
