Spaces:
Paused
Paused
Download src/helpers/bottleneck_trakt.js from mikmc/random-test: direct link, hf CLI and curl.
- Browser
- Download file 517 Bytes
-
https://huggingface.co/spaces/mikmc/random-test/resolve/main/src/helpers/bottleneck_trakt.js
- Command line
-
hf download hf://spaces/mikmc/random-test/src/helpers/bottleneck_trakt.js
-
curl -L -o bottleneck_trakt.js https://huggingface.co/spaces/mikmc/random-test/resolve/main/src/helpers/bottleneck_trakt.js
517 Bytes
| const Bottleneck = require('bottleneck'); | |
| const traktLimiterGET = new Bottleneck({ | |
| reservoir: 1000, | |
| reservoirRefreshAmount: 1000, | |
| reservoirRefreshInterval: 300 * 1000, | |
| maxConcurrent: 10 | |
| }); | |
| const traktLimiterPOST = new Bottleneck({ | |
| minTime: 1000, | |
| maxConcurrent: 1 | |
| }); | |
| const addToQueueGET = (task) => { | |
| return traktLimiterGET.schedule(task.fn); | |
| }; | |
| const addToQueuePOST = (task) => { | |
| return traktLimiterPOST.schedule(task.fn); | |
| }; | |
| module.exports = { addToQueueGET, addToQueuePOST }; | |