diff options
| author | Omar Roth <omarroth@hotmail.com> | 2018-02-05 19:07:49 -0600 |
|---|---|---|
| committer | Omar Roth <omarroth@hotmail.com> | 2018-02-05 19:07:49 -0600 |
| commit | 990bca5af536322bb11a6d783e182855258ccbc6 (patch) | |
| tree | bb570158b8b7a7fae0e522e4b1276318a03ed120 /src/helpers.cr | |
| parent | 0e704056a17e1af4ea91da1e9f85884101bf1bd9 (diff) | |
| download | invidious-990bca5af536322bb11a6d783e182855258ccbc6.tar.gz invidious-990bca5af536322bb11a6d783e182855258ccbc6.tar.bz2 invidious-990bca5af536322bb11a6d783e182855258ccbc6.zip | |
Refactor client creation
Diffstat (limited to 'src/helpers.cr')
| -rw-r--r-- | src/helpers.cr | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/helpers.cr b/src/helpers.cr index 23cab087..27c49c6e 100644 --- a/src/helpers.cr +++ b/src/helpers.cr @@ -209,3 +209,10 @@ def rank_videos(db, n) # Return top return top[1..n] end + +def make_client(url, context) + client = HTTP::Client.new(URL, CONTEXT) + client.read_timeout = 10.seconds + client.connect_timeout = 10.seconds + return client +end |
