Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add optional idle timeout shutdown#7177

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
gaberudy wants to merge4 commits intocoder:main
base:main
Choose a base branch
Loading
fromgoldenhelix:idle-timeout-2

Conversation

gaberudy
Copy link

I did this for my needs but realized there is a closed issue (not implemented) that is requesting the same thing.

Through the idle-timeout arg or IDLE_TIMEOUT environment variable, after the specified number of minutes since the heartbeat was last refreshed is detected, the code-server process shuts down. When run as the single process of a docker container, this just stops the container.

Fixes#1636

uniqueinput, leanne73, and thatguyinabeanie reacted with thumbs up emojigskifstad reacted with heart emoji
@gskifstad
Copy link

hi! our team would love this feature as well. I see there is a stray merge conflict causing linter errors, but otherwise, is there anything blocking this PR?

leanne73 and thatguyinabeanie reacted with thumbs up emojileanne73 and thatguyinabeanie reacted with eyes emoji

@code-asher
Copy link
Member

Yeah happy to merge this in if the conflicts and below are addressed.

I think the heart counting inactivity and directly exiting the process is more than it should be doing. Maybe we could refactor so the heart has anonChange event that is called when the state changes to eitheractive orinactive? Then we can tie it all together inentry.ts.

// could propagate the event through `server` or maybe we could just pass the `heart` itself backserver.onChange((state) => {  if (state === "active") {    clearTimeout(timer)  } else if (args["idle-timeout"]) {    timer = setTimeout(() => {      logger.warn(`Idle timeout of ${args["idle-timeout"]} minutes exceeded`)      wrapper.exit();    }, args["idle-timeout"] * 60 * 1000);  }})

Something like that.

I think if we have the flag asidle-timeout we might want to have it in seconds by default and allowm orh ors suffixes? Or change the flag toidle-timeout-minutes or something.

One other thing, we should check theparseInt forNaN.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Add--idle-timeout to shutdown code-server when there isn't an active connection
3 participants
@gaberudy@gskifstad@code-asher

[8]ページ先頭

©2009-2025 Movatter.jp