Skip to content

Commit

Permalink
Add a limit to the time a request can take before timing out
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Jan 15, 2025
1 parent 8793682 commit 45d94c8
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<img src="https://i.imgur.com/FIGZdR3.png">
</p>

Current version: **4.1.6**
Current version: **4.1.7**

# About
This takes ESPN+, ESPN, FOX Sports, CBS Sports, Paramount+, Gotham Sports, NFL, B1G+, NESN, Mountain West, FloSports, or MLB.tv programming and transforms it into a "live TV" experience with virtual linear channels. It will discover what is on, and generate a schedule of channels that will give you M3U and XMLTV files that you can import into something like [Jellyfin](https://jellyfin.org) or [Channels](https://getchannels.com).
Expand Down
4 changes: 4 additions & 0 deletions index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {serveStatic} from '@hono/node-server/serve-static';
import {BlankEnv, BlankInput} from 'hono/types';
import {html} from 'hono/html';
import moment from 'moment';
import axios from 'axios';

import {generateM3u} from './services/generate-m3u';
import {initDirectories} from './services/init-directories';
Expand Down Expand Up @@ -51,6 +52,9 @@ import {ESPN} from './services/providers/espn/views';
import {ESPNPlus} from './services/providers/espn-plus/views';
import {Gotham} from './services/providers/gotham/views';

// Set timeout of requests to 1 minute
axios.defaults.timeout = 1000 * 60;

const notFound = (c: Context<BlankEnv, '', BlankInput>) => {
return c.text('404 not found', 404, {
'X-Tuner-Error': 'EPlusTV: Error getting content',
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eplustv",
"version": "4.1.6",
"version": "4.1.7",
"description": "",
"scripts": {
"start": "ts-node -r tsconfig-paths/register index.tsx",
Expand Down
2 changes: 2 additions & 0 deletions services/flo-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ class FloSportsHandler {
headers: {
Authorization: `Bearer ${this.access_token}`,
},
// This request can take a long time so increasing the timeout
timeout: 1000 * 60 * 5,
});

debug.saveRequestData(data, 'flosports', 'epg');
Expand Down

0 comments on commit 45d94c8

Please sign in to comment.