From 48aba334a069e185cacf696c3e4d7c077015d211 Mon Sep 17 00:00:00 2001 From: aceberg <1502200+aceberg@users.noreply.github.com> Date: Sat, 26 Jul 2025 20:52:25 +0700 Subject: [PATCH] GORM logger timeout --- CHANGELOG.md | 12 ++++++------ README.md | 3 +-- internal/gdb/start.go | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d1124a..6e037c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,15 +2,15 @@ All notable changes to this project will be documented in this file. ## [v2.1.3] - 2025-0 -### Changed -- Upd to `go 1.24.5` -- Moved `DB` handling to `GORM` -- Moved to `github.com/nicholas-fedor/shoutrrr` [#197](https://github.com/aceberg/WatchYourLAN/pull/197) -- Removed `HIST_IN_DB` config option. Now history is always stored in `DB` - ### Fixed - Memory leak bug [#149](https://github.com/aceberg/WatchYourLAN/pull/149) +### Changed +- **DEPRECATED:** `HIST_IN_DB` config option. Now history is always stored in `DB` +- Upd to `go 1.24.5` +- Moved `DB` handling to `GORM` +- Moved to maintained `Shoutrrr`: [github.com/nicholas-fedor/shoutrrr](github.com/nicholas-fedor/shoutrrr) ([#197](https://github.com/aceberg/WatchYourLAN/pull/197)) + ## [v2.1.2] - 2025-03-30 ### Fixed - Edit names bug diff --git a/README.md b/README.md index 7c8df9c..c037cee 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ Configuration can be done through config file, GUI or environment variables. Var | ARP_STRS ARP_STRS_JOINED | See [docs/VLAN_ARP_SCAN.md](https://github.com/aceberg/WatchYourLAN/blob/main/docs/VLAN_ARP_SCAN.md). | | | LOG_LEVEL | Log level: `debug`, `info`, `warn` or `error` | info | | TRIM_HIST | Remove history after (hours) | 48 | -| HIST_IN_DB | Store History in DB - if `false`, the History will be stored only in memory and will be lost on app restart. Though, it will keep the app DB smaller (InfluxDB or Prometheus is recommended for long-term History storage) | false | +| HIST_IN_DB | DEPRECATED since 2.1.3. Now History is always stored in DB. Use TRIM_HIST to reduce DB size | | | USE_DB | Either `sqlite` or `postgres` | sqlite | | PG_CONNECT | Address to connect to PostgreSQL. (Example: `postgres://username:password@192.168.0.1:5432/dbname?sslmode=disable`). Full list of URL parameters [here](https://pkg.go.dev/github.com/lib/pq#hdr-Connection_String_Parameters) | | @@ -139,7 +139,6 @@ Config file name is `config_v2.yaml`. Example: ```yaml arp_args: "" color: dark -hist_in_db: false host: 0.0.0.0 ifaces: enp4s0 influx_addr: "" diff --git a/internal/gdb/start.go b/internal/gdb/start.go index 153f2fc..1c45c67 100644 --- a/internal/gdb/start.go +++ b/internal/gdb/start.go @@ -29,7 +29,7 @@ func Start() { newLogger := logger.New( log.New(os.Stdout, "\r\n", log.LstdFlags), logger.Config{ - SlowThreshold: time.Second, + SlowThreshold: 5 * time.Second, LogLevel: logger.Warn, IgnoreRecordNotFoundError: true, Colorful: true,