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

feat: Expose the RequestTimeout configuration setting to app service #1039

Merged

Conversation

lenny-goodell
Copy link
Member

@lenny-goodell lenny-goodell commented Feb 2, 2022

Added the RequestTimeout() method on the ApplicationService Interface
with returns a time.Duration. The questTimeout configuration setting
is pared during initialztion so error can be caught during start-up.

Signed-off-by: Leonard Goodell [email protected]

If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/app-functions-sdk-go/blob/main/.github/CONTRIBUTING.md

PR Checklist

Please check if your PR fulfills the following requirements:

  • I am not introducing a breaking change (if you are, flag in conventional commit message with BREAKING CHANGE: describing the break)
  • I am not introducing a new dependency (add notes below if you are)
  • I have added unit tests for the new feature or bug fix (if not, why?) N/A - Initialize can't be unit tested
  • I have fully tested (add details below) this the new feature or bug fix (if not, why?)
  • I have opened a PR for the related docs change (if not, why?)
    feat: Document new RequestTimeout Application Service API edgex-docs#689

Testing Instructions

Add the following line app template main.go on this branch (around line 65)

	app.lc.Infof("Request Timeout is set to: %v", app.service.RequestTimeout())

Build and run app template
Verify the following is in the logs:

level=INFO ts=2022-02-02T22:18:43.2279695Z app=new-app-service source=main.go:65 msg="Request Timeout is set to: 5s"

Modify Service.RequestTimout in res/configuration.toml to be set to "5"
Rerun App Template and verify it fails to start-up with the following message:

level=ERROR ts=2022-02-02T22:29:13.1180933Z app=new-app-service source=factory.go:43 msg="App Service initialization failed: unable to parse Service.RequestTimeout configuration as a time duration: time: missing unit in duration \"5\""

New Dependency Instructions (If applicable)

N/A

@lenny-goodell lenny-goodell added the enhancement New feature or request label Feb 2, 2022
@lenny-goodell lenny-goodell added this to the Kamakura milestone Feb 2, 2022
@lenny-goodell lenny-goodell force-pushed the expose-request-timeout branch 2 times, most recently from b7e257e to 0a88b62 Compare February 2, 2022 22:56
Added the RequestTimeout() method on the ApplicationService Interface
with returns a time.Duration. The questTimeout configuration setting
is pared during initialztion so error can be caught during start-up.

Signed-off-by: Leonard Goodell <[email protected]>
@lenny-goodell lenny-goodell force-pushed the expose-request-timeout branch from 0a88b62 to 3118917 Compare February 2, 2022 22:58
@codecov-commenter
Copy link

Codecov Report

Merging #1039 (3118917) into main (935ffde) will decrease coverage by 0.16%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1039      +/-   ##
==========================================
- Coverage   68.90%   68.73%   -0.17%     
==========================================
  Files          36       36              
  Lines        2865     2872       +7     
==========================================
  Hits         1974     1974              
- Misses        780      787       +7     
  Partials      111      111              
Impacted Files Coverage Δ
internal/app/service.go 54.51% <0.00%> (-1.22%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 935ffde...3118917. Read the comment docs.

@lenny-goodell lenny-goodell merged commit c8cbc5e into edgexfoundry:main Feb 3, 2022
@lenny-goodell lenny-goodell deleted the expose-request-timeout branch February 3, 2022 00:14
FelixTing pushed a commit to FelixTing/app-functions-sdk-go that referenced this pull request Mar 3, 2022
…dgexfoundry#1039)

Added the RequestTimeout() method on the ApplicationService Interface
with returns a time.Duration. The questTimeout configuration setting
is pared during initialztion so error can be caught during start-up.

Signed-off-by: Leonard Goodell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants