Commit Graph
24 Commits
Author SHA1 Message Date
w1ndyb0y 419f25f0dd fix: comprehensive bug fixes and architecture restructuring
Phase 1 — Bug fixes (7 bugs):
- Bug 1: Pulsar mode data loss — always persist to SQLite regardless of mode
- Bug 2: PulsarSend closing TCP client — use independent resetPulsarProducer()
- Bug 3: Greedy regex — use non-greedy (?s)ZCZC.*?NNNN
- Bug 4: Data after NNNN discarded — keep remaining buffer data
- Bug 5: strings.Index > 0 boundary — use strings.Contains
- Bug 6: Variable shadowing in PulsarSend — use = not :=
- Bug 7: Accept failure nil panic — add continue + retry logic

Phase 2 — Architecture restructuring:
- Split utils/ into config/, serial/, telegram/, storage/, transport/
- Define Sender, Repository, Reader interfaces
- Introduce app/ layer with context.Context lifecycle
- Replace spinlock with sync.Mutex
- Unified Config struct replaces 15+ global vars

Phase 3 — Testing & tooling:
- telegram/parser_test.go (7 test cases)
- storage/store_test.go (5 test cases)
- transport/transport_test.go (4 test cases)
- Taskfile: add test, test-race, test-cover tasks
- Go version: 1.15 -> 1.21
2026-07-10 15:32:34 +08:00
w1ndyb0y fe1a8169e6 move pulsar send to telegram.go 2021-02-01 17:13:54 +08:00
w1ndyb0y 3ad4c76acd add pulsar client 2021-02-01 15:35:13 +08:00
w1ndyb0y 98cf3fa0e3 ignore rawlog error 2020-12-31 10:46:34 +08:00
w1ndyb0y b0836f95b0 remove brace 2020-12-31 10:45:07 +08:00
zhiqiang feng 8ed16fd502 add new line 2020-12-29 11:43:43 +08:00
zhiqiang feng e25420a20e add new line 2020-12-29 11:35:09 +08:00
zhiqiang feng 0b0e3637bf add new line 2020-12-29 11:30:19 +08:00
fengzhiqiang fe4faf5a59 disable verbose 2020-12-29 11:28:10 +08:00
zhiqiang feng bb736bba85 fix append 2020-12-29 11:11:13 +08:00
zhiqiang feng 2011a10464 use new serial lib 2020-12-29 11:00:01 +08:00
zhiqiang feng 28ac23e47b add new line 2020-12-28 17:01:14 +08:00
zhiqiang feng ad2cccc3f9 add new line every telegram 2020-12-28 16:58:36 +08:00
zhiqiang feng 7375808704 match \n 2020-12-28 16:54:42 +08:00
zhiqiang feng b59d135dff mathch \n 2020-12-28 16:52:56 +08:00
zhiqiang feng c9bd9fe11d remove empty 2020-12-28 16:49:36 +08:00
zhiqiang feng fd41bf4698 remove empty 2020-12-28 16:46:25 +08:00
zhiqiang feng 68069dec34 add rawlog 2020-12-28 16:36:59 +08:00
zhiqiang feng f9c71978fd remove telegram text log 2020-12-28 16:13:57 +08:00
zhiqiang feng 0619229ec5 add zap logger 2020-12-28 15:58:00 +08:00
zhiqiang feng 2cbfbdbbca add zap for default logger 2020-12-28 11:06:36 +08:00
w1ndyb0y 594f1e6778 add telegram insert 2020-12-21 17:59:37 +08:00
w1ndyb0y 5fb48afd7b remove start tag 2020-12-21 16:21:43 +08:00
w1ndyb0y 481870cea9 check telegram string 2020-12-21 16:18:08 +08:00