Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom idleTimeout env variable #1089

Open
wants to merge 1 commit into
base: 1.x
Choose a base branch
from

Conversation

HijenHEK
Copy link

Custom idleTimeout env variable

Current state

timeout is hardcoded in the server and the handler to 120 according to the ws protocol

image

Why this is important

A Custom idleTimeout is necessary specially in testing environment , some use cases are :

  • app still in development
  • testing ws with postman
  • internal or local production env

Changes :

  • added the SOKETI_IDLE_TIMEOUT env variable in cli.ts
  • added the idleTimeout as a number in options.ts
  • settled the variable as the option indicates with a default of 120, server.ts & ws-handler.ts

Result

SOKETI_IDLE_TIMEOUT=180 node bin/server.js start

image

Copy link

codeautopilot bot commented Dec 30, 2023

PR summary

The Pull Request introduces a new environment variable SOKETI_IDLE_TIMEOUT to customize the idle timeout for WebSocket connections in the soketi server. Previously, the timeout was hardcoded to 120 seconds. This change allows for greater flexibility, especially in testing environments or during development. The default value remains 120 seconds if the environment variable is not set.

Suggestion

Ensure that the documentation is updated to reflect the addition of the new environment variable and provide guidance on how to use it effectively. Additionally, consider adding validation to ensure that the provided SOKETI_IDLE_TIMEOUT value is a positive integer and within a reasonable range to prevent misconfiguration.

Disclaimer: This comment was entirely generated using AI. Be aware that the information provided may be incorrect.

Current plan usage: 35.39%

Have feedback or need help?
Discord
Documentation
[email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant