rauchg / slackin

Public Slack organizations made easy
http://rauchg.com/slackin/
MIT License
6.51k stars 1.34k forks source link

Too rapid polling/querying #389

Closed KrzysztofMadejski closed 5 years ago

KrzysztofMadejski commented 5 years ago

Why slackin is querying slack (I guess that is what happens) so often? Each 300-800ms? Each 5 mins would be totally enough. Isn't there any flag to configure it to happen less often?

Mon Dec 10 2018 13:58:43 GMT+0000 (Coordinated Universal Time) – online 36, total 572 (+797ms)
Mon Dec 10 2018 13:58:48 GMT+0000 (Coordinated Universal Time) – fetching
Mon Dec 10 2018 13:58:48 GMT+0000 (Coordinated Universal Time) – online 36, total 572 (+342ms)
Mon Dec 10 2018 13:58:53 GMT+0000 (Coordinated Universal Time) – fetching
Mon Dec 10 2018 13:58:54 GMT+0000 (Coordinated Universal Time) – online 36, total 572 (+824ms)
Mon Dec 10 2018 13:58:59 GMT+0000 (Coordinated Universal Time) – fetching
Mon Dec 10 2018 13:59:00 GMT+0000 (Coordinated Universal Time) – online 36, total 572 (+803ms)
Mon Dec 10 2018 13:59:05 GMT+0000 (Coordinated Universal Time) – fetching
Mon Dec 10 2018 13:59:06 GMT+0000 (Coordinated Universal Time) – online 35, total 572 (+817ms)
Mon Dec 10 2018 13:59:11 GMT+0000 (Coordinated Universal Time) – fetching
Mon Dec 10 2018 13:59:11 GMT+0000 (Coordinated Universal Time) – online 35, total 572 (+786ms)
Mon Dec 10 2018 13:59:16 GMT+0000 (Coordinated Universal Time) – fetching
Mon Dec 10 2018 13:59:17 GMT+0000 (Coordinated Universal Time) – online 36, total 572 (+702ms)
Mon Dec 10 2018 13:59:22 GMT+0000 (Coordinated Universal Time) – fetching
Mon Dec 10 2018 13:59:23 GMT+0000 (Coordinated Universal Time) – online 36, total 572 (+680ms)
Mon Dec 10 2018 13:59:28 GMT+0000 (Coordinated Universal Time) – fetching
Mon Dec 10 2018 13:59:29 GMT+0000 (Coordinated Universal Time) – online 35, total 572 (+854ms)
Mon Dec 10 2018 13:59:34 GMT+0000 (Coordinated Universal Time) – fetching
Mon Dec 10 2018 13:59:35 GMT+0000 (Coordinated Universal Time) – online 35, total 572 (+836ms)
Mon Dec 10 2018 13:59:40 GMT+0000 (Coordinated Universal Time) – fetching
Mon Dec 10 2018 13:59:40 GMT+0000 (Coordinated Universal Time) – online 35, total 572 (+859ms)
Mon Dec 10 2018 13:59:45 GMT+0000 (Coordinated Universal Time) – fetching
Mon Dec 10 2018 13:59:46 GMT+0000 (Coordinated Universal Time) – online 35, total 572 (+329ms)
Mon Dec 10 2018 13:59:51 GMT+0000 (Coordinated Universal Time) – fetching
Mon Dec 10 2018 13:59:52 GMT+0000 (Coordinated Universal Time) – online 35, total 572 (+808ms)
Mon Dec 10 2018 13:59:57 GMT+0000 (Coordinated Universal Time) – fetching
Mon Dec 10 2018 13:59:57 GMT+0000 (Coordinated Universal Time) – online 35, total 572 (+812ms)
Mon Dec 10 2018 14:00:02 GMT+0000 (Coordinated Universal Time) – fetching
Mon Dec 10 2018 14:00:03 GMT+0000 (Coordinated Universal Time) – online 36, total 572 (+371ms)
Mon Dec 10 2018 14:00:08 GMT+0000 (Coordinated Universal Time) – fetching
Mon Dec 10 2018 14:00:08 GMT+0000 (Coordinated Universal Time) – Error: Too Many Requests
    at Request.callback (/srv/slackin/node_modules/superagent/lib/node/index.js:686:11)
    at /srv/slackin/node_modules/superagent/lib/node/index.js:868:18
    at IncomingMessage.<anonymous> (/srv/slackin/node_modules/superagent/lib/node/parsers/json.js:16:7)
    at IncomingMessage.emit (events.js:194:15)
    at endReadableNT (_stream_readable.js:1107:12)
    at process.internalTickCallback (internal/process/next_tick.js:72:19)
sntxrr commented 5 years ago

@KrzysztofMadejski if you pass in --interval 300000 you can slow down how often it checks. See https://github.com/rauchg/slackin/blob/master/bin/slackin#L11

KrzysztofMadejski commented 5 years ago

Perfect! Thanks @sntxrr !

loleg commented 4 years ago

Setting the SLACK_INTERVAL environment variable to 300000 also solved the issue for me. It's a good workaround until #303 is merged, and might be good to add to the default vars if it persists.