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

NOISSUE - Improve graceful shutdown and code quality #1821

Merged
merged 8 commits into from
Jul 28, 2023

Conversation

SammyOina
Copy link
Contributor

@SammyOina SammyOina commented Jun 16, 2023

What does this do?

  • Improve graceful stop
  • Remove duplicate cases
  • Remove single case switch

Which issue(s) does this PR fix/relate to?

None

List any changes that modify/break current functionality

None

Have you included tests for your changes?

No

Did you document any new/modified functionality?

No

Notes

@codecov
Copy link

codecov bot commented Jun 16, 2023

Codecov Report

Merging #1821 (5e1120a) into master (2b78902) will increase coverage by 0.15%.
Report is 1 commits behind head on master.
The diff coverage is 90.00%.

@@            Coverage Diff             @@
##           master    #1821      +/-   ##
==========================================
+ Coverage   64.73%   64.89%   +0.15%     
==========================================
  Files         118      119       +1     
  Lines        9702     9745      +43     
==========================================
+ Hits         6281     6324      +43     
  Misses       2753     2753              
  Partials      668      668              
Files Changed Coverage Δ
consumers/writers/postgres/consumer.go 66.36% <0.00%> (+0.59%) ⬆️
consumers/writers/timescale/consumer.go 67.64% <0.00%> (+0.65%) ⬆️
logger/exit.go 0.00% <0.00%> (ø)
pkg/sdk/go/message.go 42.85% <0.00%> (ø)
users/clients/service.go 59.84% <0.00%> (ø)
mqtt/handler.go 92.12% <100.00%> (ø)
pkg/messaging/rabbitmq/publisher.go 68.18% <100.00%> (ø)
pkg/transformers/json/transformer.go 78.49% <100.00%> (-0.23%) ⬇️
readers/api/transport.go 70.00% <100.00%> (-0.25%) ⬇️
readers/influxdb/messages.go 85.27% <100.00%> (+1.66%) ⬆️
... and 3 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@SammyOina SammyOina marked this pull request as ready for review June 16, 2023 16:01
@SammyOina SammyOina requested a review from a team as a code owner June 16, 2023 16:01
@SammyOina SammyOina changed the title NOISSUE - Improve code quality NOISSUE - Improve graceful shutdown and code quality Jun 19, 2023
@SammyOina SammyOina force-pushed the code-quality branch 4 times, most recently from 621164c to 7b2e889 Compare June 26, 2023 14:01
@SammyOina SammyOina force-pushed the code-quality branch 5 times, most recently from 3242153 to 6efef79 Compare July 13, 2023 08:01
@SammyOina SammyOina force-pushed the code-quality branch 3 times, most recently from f093ab1 to 1479657 Compare July 13, 2023 17:46
@arvindh123
Copy link
Contributor

arvindh123 commented Jul 18, 2023

@dborovcanin @SammyOina
Same Code is repeating in all main.go
So only proposed log.Fatalf , Since we don't to change analogous of log.Fatalf
Can we have some other name with same function like log.ErrorExit

@arvindh123
Copy link
Contributor

@SammyOina Why we are removing single switch case ?

@SammyOina SammyOina force-pushed the code-quality branch 2 times, most recently from d644cac to 681fb99 Compare July 22, 2023 14:42
cli/config.go Outdated Show resolved Hide resolved
@arvindh123
Copy link
Contributor

LGTM

remove duplicate cases

Signed-off-by: SammyOina <sammyoina@gmail.com>
Signed-off-by: SammyOina <sammyoina@gmail.com>
Signed-off-by: SammyOina <sammyoina@gmail.com>
Signed-off-by: SammyOina <sammyoina@gmail.com>
Signed-off-by: SammyOina <sammyoina@gmail.com>
Signed-off-by: SammyOina <sammyoina@gmail.com>
Signed-off-by: SammyOina <sammyoina@gmail.com>
Copy link
Contributor

@drasko drasko left a comment

Choose a reason for hiding this comment

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

LGTM

@drasko drasko merged commit 7758f42 into absmach:master Jul 28, 2023
3 checks passed
rodneyosodo pushed a commit to rodneyosodo/magistrala that referenced this pull request Aug 3, 2023
* remove single case switch
remove duplicate cases

Signed-off-by: SammyOina <sammyoina@gmail.com>

* remove single case switch \n format comments

Signed-off-by: SammyOina <sammyoina@gmail.com>

* graceful exit on main func

Signed-off-by: SammyOina <sammyoina@gmail.com>

* remove fatal from imported packages

Signed-off-by: SammyOina <sammyoina@gmail.com>

* reuse exit function

Signed-off-by: SammyOina <sammyoina@gmail.com>

* return nill for empty configs

Signed-off-by: SammyOina <sammyoina@gmail.com>

* return nil for config file not found

Signed-off-by: SammyOina <sammyoina@gmail.com>

---------

Signed-off-by: SammyOina <sammyoina@gmail.com>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
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.

4 participants