Skip to content

Conversation

@nijikokun
Copy link
Contributor

The disconnect function was only removing the session from the mutex without properly closing it when calling ngrok.kill or ngrok.disconnect. This change ensures the session's close() method is called before removing it, which properly shuts down the ngrok session/agent.

Starting a tunnel and running await ngrok.kill():
image

Then running ngrok http 80 in another terminal:
image

Attempting to run the script while the CLI agent is running (as a test that I do indeed get this when >1 agent runs):
image

Note: While this does fix #148 the session still can take up to 1-3 seconds to close. Mileage may vary.

fixes #148


Note: The smoke test pass, I could not run the full suite so need to test this on my other machine. Additionally, it was not clear whether I should commit the index file generated by the build process or let the workflow do this. On my machine I could only run the debug build process so I did not commit those files.

The disconnect function was only removing the session from the mutex without properly
closing it. This change ensures the session's close() method is called before
removing it, which properly shuts down the ngrok session/agent.

fixes #148
@ghost ghost self-requested a review March 17, 2025 18:34
@ghost
Copy link

ghost commented Mar 17, 2025

I will merge in main and rerun tests after this PR merges: #164

@ghost ghost merged commit 3d4416d into main Mar 18, 2025
23 checks passed
@ghost ghost deleted the niji/close-session branch March 18, 2025 14:30
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to stop the Agent

2 participants