Skip to content

feat(api): manage power state timeout #1929

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

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

Conversation

mjdivankoller
Copy link
Contributor

PR Checklist

  • [x ] Unit Tests have been added for new changes
  • API tests have been updated if applicable
  • [x ] All commented code has been removed
  • [x ] If you've added a dependency, you've ensured license is compatible with Apache 2.0 and clearly outlined the added dependency.

What are you changing?

  1. It incorporates helper functions and parameters to manage timeouts with async functions
  2. It implements a timeout for getPowerState, defining 10000 milliseconds (or 10 seconds) as the default
  3. A 404 HTTP response is given when a timeout is triggered.

Anything the reviewer should know when reviewing this PR?

  1. Logs associated with the expected response: test_getPowerState_ok_log.txt
    test_getPowerState_ok

  2. Logs associated with the timeout after unplugging the cord: test_getPowerState_timeout_log.txt
    test_getPowerState_timeout

  3. Logs associated with the expected response after plugging again the cord: test_getPowerState_plugaftertimeout_log.txt
    test_getPowerState_plugaftertimeout

You can define a different value for the default timeout, modifying the "timeout_ms_default" parameter in .mpsrc.

If the there are associated PRs in other repositories, please link them here (i.e. device-management-toolkit/repo#365 )

None

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.

1 participant