Skip to content

Conversation

AnalogJ
Copy link
Owner

@AnalogJ AnalogJ commented Aug 3, 2022

AnalogJ and others added 27 commits July 13, 2022 21:56
- freebsd binaries for collector and web working
- macos binaries for arm and amd.
- updated dbdiagrams schema
- [BREAKING] force failure if `notify.filter_attributes` or `notify.level` is set
- added Settings table (and default values during migration)
- Added Save Settings and Get Settings functions.
- Added web API endpoints for getting and saving settings.
- Deprecated old Notify* constants. Created new MetricsStatus* and MetricsNotifyLevel constants.
Settings are loaded from the DB and added to the AppConfig during startup.
When updating settings, they are stored in AppConfig, and written do  the database.
…ult).

Converted all settings keys to snakecase.
update the frontend to persist settings to the database.
Using ScrutinyConfigService instead of TreoConfigService.
Using snake case settings in frontend.
Make sure we're using AppConfig type where possible.
Ensure device status takes into account new settings.
adding tests. Make sure that device status depends on the configured threshold
Typo: Created and loaded config into `conf/`, but specifies `config/` in argument
Synology task will fail when not executable:

```
/bin/bash: /volume1/@Entware/scrutiny/bin/run_collect.sh: Permission denied
```
When a transaction cannot lock the database, because it is already locked by another one,
SQLite by default throws an error: database is locked. This behavior is usually not appropriate when
concurrent access is needed, typically when multiple processes write to the same database.
PRAGMA busy_timeout lets you set a timeout or a handler for these events. When setting a timeout,
SQLite will try the transaction multiple times within this timeout.
https://rsqlite.r-dbi.org/reference/sqlitesetbusyhandler

retrying for 30000 milliseconds, 30seconds - this would be unreasonable for a distributed multi-tenant application,
but should be fine for local usage.

added mechanism for global settings (PRAGMA and DB level instructions).

fixes #341
@codecov-commenter
Copy link

codecov-commenter commented Aug 3, 2022

Codecov Report

Merging #352 (d41d535) into master (a01b8fe) will decrease coverage by 0.38%.
The diff coverage is 27.27%.

@@            Coverage Diff             @@
##           master     #352      +/-   ##
==========================================
- Coverage   32.69%   32.30%   -0.39%     
==========================================
  Files          51       54       +3     
  Lines        2753     3055     +302     
  Branches       61       66       +5     
==========================================
+ Hits          900      987      +87     
- Misses       1821     2032     +211     
- Partials       32       36       +4     
Flag Coverage Δ
unittests 32.30% <27.27%> (-0.39%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
webapp/backend/pkg/config/config.go 0.00% <0.00%> (ø)
webapp/backend/pkg/database/scrutiny_repository.go 12.60% <0.00%> (-0.92%) ⬇️
...end/pkg/database/scrutiny_repository_migrations.go 0.00% <0.00%> (ø)
...ckend/pkg/database/scrutiny_repository_settings.go 0.00% <0.00%> (ø)
webapp/frontend/src/app/layout/layout.component.ts 2.50% <20.00%> (ø)
...end/src/app/core/config/scrutiny-config.service.ts 42.85% <42.85%> (ø)
...bapp/frontend/src/app/shared/device-status.pipe.ts 64.70% <62.50%> (+54.70%) ⬆️
webapp/frontend/src/app/shared/file-size.pipe.ts 78.57% <76.92%> (-6.05%) ⬇️
...mon/dashboard-device/dashboard-device.component.ts 73.07% <80.00%> (+17.52%) ⬆️
webapp/backend/pkg/notify/notify.go 35.76% <85.36%> (+18.09%) ⬆️
... and 10 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

AnalogJ added 7 commits August 3, 2022 18:38
Ensure logger creation is consistent between Web and Collector
Create logger in main, pass down to downstream functions (like gin)
In debug mode, print a copy of AppConfig
Better debugging for logger.
…example.scrutiny.yaml, since they are no longer allowed.
@AnalogJ AnalogJ merged commit d8d56f7 into master Aug 4, 2022
@AnalogJ AnalogJ deleted the beta branch April 6, 2023 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment