slackapi / node-slack-sdk

Slack Developer Kit for Node.js
https://tools.slack.dev/node-slack-sdk/
MIT License
3.27k stars 662 forks source link

Is it possible to set Timeout on send()? #1576

Closed austinp0wers closed 1 year ago

austinp0wers commented 1 year ago

(Describe your issue and goal here)

Packages:

Select all that apply:

Reproducible in:

The Slack SDK version

"@slack/webhook": "^6.0.0",

Node.js runtime version

v16.15.0

OS info

mac OS Ventura

I would like to add timeout for this hook as i am planning on running this onApplicationShutdown However it seems like there are no such options as timeout in this function.

스크린샷 2022-12-28 오전 10 04 59
seratch commented 1 year ago

Hi @austinp0wers, you can pass timeout when initializing an IncomingWebhook instance: https://github.com/slackapi/node-slack-sdk/blob/%40slack/webhook%406.1.0/packages/webhook/src/IncomingWebhook.ts#L106

The timeout value is a duration in milliseconds.

// Setting 1000 milliseconds
const webhook = new IncomingWebhook(token, { timeout: 1000 });
github-actions[bot] commented 1 year ago

👋 It looks like this issue has been open for 30 days with no activity. We'll mark this as stale for now, and wait 10 days for an update or for further comment before closing this issue out. If you think this issue needs to be prioritized, please comment to get the thread going again! Maintainers also review issues marked as stale on a regular basis and comment or adjust status if the issue needs to be reprioritized.

github-actions[bot] commented 1 year ago

As this issue has been inactive for more than one month, we will be closing it. Thank you to all the participants! If you would like to raise a related issue, please create a new issue which includes your specific details and references this issue number.