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

Fix starting scripts from API endpoint #1937

Merged
merged 1 commit into from
Mar 3, 2025
Merged

Fix starting scripts from API endpoint #1937

merged 1 commit into from
Mar 3, 2025

Conversation

jjcarstens
Copy link
Collaborator

#1923 introduced a change to handle when scripts timeout waiting for data back. However, it missed adjusting for the change in NervesHubWeb.API.ScriptController so using the API is broken.

This fixes to match that new return value and adds a 504 response if it times out waiting for the script reply.

#1923 introduced a change to
handle when scripts timeout waiting for data back. However, it missed adjusting
for the change in `NervesHubWeb.API.ScriptController` so using the API
is broken.

This fixes to match that new return value and adds a `504` response if
it times out waiting for the script reply
@jjcarstens jjcarstens requested review from joshk, fhunleth and nshoes March 3, 2025 20:10
Comment on lines +37 to +38
{:ok, io} <- Scripts.Runner.send(device, command) do
text(conn, io)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the magic sauce to fix things. The rest is refactor since the nesting was starting to get very deep

@joshk
Copy link
Collaborator

joshk commented Mar 3, 2025

Thank you! (and sorry)

Copy link
Collaborator

@joshk joshk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@jjcarstens jjcarstens merged commit 8541721 into main Mar 3, 2025
2 checks passed
@jjcarstens jjcarstens deleted the fix-api-scripts branch March 3, 2025 22:36
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.

2 participants