Compare commits
3 Commits
544cfb5c99
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| b57221598d | |||
| 86d9c6e9c7 | |||
| 9212efc176 |
Vendored
BIN
Binary file not shown.
|
After Width: | Height: | Size: 60 MiB |
@@ -0,0 +1,2 @@
|
||||
-- Irreversible data migration for safety, or we could delete what we inserted.
|
||||
-- For now, leaving empty to avoid accidental data loss on down.
|
||||
@@ -0,0 +1,5 @@
|
||||
INSERT INTO servers (id, name, country, city, address, sort, created_at, updated_at)
|
||||
SELECT id, name, country, city, server_addr, sort, created_at, updated_at FROM server;
|
||||
|
||||
INSERT INTO nodes (name, tags, address, server_id, protocol, enabled, sort, created_at, updated_at)
|
||||
SELECT name, tags, server_addr, id, protocol, enable, sort, created_at, updated_at FROM server;
|
||||
@@ -2,6 +2,7 @@ package svc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/perfect-panel/server/internal/model/client"
|
||||
"github.com/perfect-panel/server/internal/model/node"
|
||||
@@ -78,7 +79,8 @@ func NewServiceContext(c config.Config) *ServiceContext {
|
||||
// IP location initialize
|
||||
geoIP, err := NewIPLocation("./cache/GeoLite2-City.mmdb")
|
||||
if err != nil {
|
||||
panic(err.Error())
|
||||
// panic(err.Error())
|
||||
fmt.Printf("GeoIP load failed: %v\n", err)
|
||||
}
|
||||
|
||||
rds := redis.NewClient(&redis.Options{
|
||||
|
||||
+1938
File diff suppressed because it is too large
Load Diff
@@ -308,3 +308,66 @@
|
||||
282844-12-12 00:00:00.337 [31;1m error [0;22m [GORM] duration=0.3ms caller=middleware/authMiddleware.go:83 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-03' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 error=record not found trace=ee530e7347d62a1a4a85223982d992ec span=75f86b505c590213 rows=0
|
||||
282844-12-12 00:00:00.338 [31;1m error [0;22m [GORM] duration=0.3ms caller=middleware/authMiddleware.go:83 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-02' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 error=record not found trace=ee530e7347d62a1a4a85223982d992ec span=75f86b505c590213 rows=0
|
||||
282844-12-12 00:00:00.338 [31;1m error [0;22m [GORM] duration=0.3ms caller=middleware/authMiddleware.go:83 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-01' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 error=record not found rows=0 trace=ee530e7347d62a1a4a85223982d992ec span=75f86b505c590213
|
||||
28281-12-12 00:00:00.475 [31;1m error [0;22m [Init Telegram Config] New Bot API Error: {error Not Found} caller=initialize/telegram.go:39
|
||||
282820-12-12 00:00:00.048 [31;1m error [0;22m [Init Telegram Config] New Bot API Error: {error Not Found} caller=initialize/telegram.go:39
|
||||
282848-12-12 00:00:00.172 [31;1m error [0;22m [Init Telegram Config] New Bot API Error: {error Not Found} caller=initialize/telegram.go:39
|
||||
282832-12-12 00:00:00.038 [31;1m error [0;22m [GORM] duration=1.3ms caller=middleware/authMiddleware.go:89 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-27' AND `type` = 40 ORDER BY `system_logs`.`id` LIMIT 1 rows=0 error=record not found span=cfd883a7dc7270b7 trace=5a9a567b61b723bdfc6136ec158de571
|
||||
282832-12-12 00:00:00.041 [31;1m error [0;22m [GORM] duration=2.1ms caller=middleware/authMiddleware.go:89 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-27' AND `type` = 41 ORDER BY `system_logs`.`id` LIMIT 1 error=record not found span=cfd883a7dc7270b7 rows=0 trace=5a9a567b61b723bdfc6136ec158de571
|
||||
282832-12-12 00:00:00.049 [31;1m error [0;22m [GORM] duration=0.7ms caller=middleware/authMiddleware.go:89 error=record not found trace=5a9a567b61b723bdfc6136ec158de571 span=cfd883a7dc7270b7 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-27' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 rows=0
|
||||
282832-12-12 00:00:00.050 [31;1m error [0;22m [GORM] duration=0.6ms caller=middleware/authMiddleware.go:89 rows=0 error=record not found trace=5a9a567b61b723bdfc6136ec158de571 span=cfd883a7dc7270b7 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-26' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1
|
||||
282832-12-12 00:00:00.051 [31;1m error [0;22m [GORM] duration=1.1ms caller=middleware/authMiddleware.go:89 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-25' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 rows=0 span=cfd883a7dc7270b7 error=record not found trace=5a9a567b61b723bdfc6136ec158de571
|
||||
282832-12-12 00:00:00.053 [31;1m error [0;22m [GORM] duration=1.9ms caller=middleware/authMiddleware.go:89 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-24' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 rows=0 span=cfd883a7dc7270b7 error=record not found trace=5a9a567b61b723bdfc6136ec158de571
|
||||
282832-12-12 00:00:00.054 [31;1m error [0;22m [GORM] duration=0.6ms caller=middleware/authMiddleware.go:89 rows=0 error=record not found trace=5a9a567b61b723bdfc6136ec158de571 span=cfd883a7dc7270b7 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-23' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1
|
||||
282832-12-12 00:00:00.054 [31;1m error [0;22m [GORM] duration=0.4ms caller=middleware/authMiddleware.go:89 rows=0 error=record not found trace=5a9a567b61b723bdfc6136ec158de571 span=cfd883a7dc7270b7 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-22' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1
|
||||
282832-12-12 00:00:00.054 [31;1m error [0;22m [GORM] duration=0.4ms caller=middleware/authMiddleware.go:89 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-21' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 trace=5a9a567b61b723bdfc6136ec158de571 span=cfd883a7dc7270b7 rows=0 error=record not found
|
||||
282832-12-12 00:00:00.055 [31;1m error [0;22m [GORM] duration=0.5ms caller=middleware/authMiddleware.go:89 error=record not found span=cfd883a7dc7270b7 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-20' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 rows=0 trace=5a9a567b61b723bdfc6136ec158de571
|
||||
282832-12-12 00:00:00.055 [31;1m error [0;22m [GORM] duration=0.4ms caller=middleware/authMiddleware.go:89 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-19' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 error=record not found trace=5a9a567b61b723bdfc6136ec158de571 rows=0 span=cfd883a7dc7270b7
|
||||
282832-12-12 00:00:00.056 [31;1m error [0;22m [GORM] duration=0.3ms caller=middleware/authMiddleware.go:89 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-18' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 rows=0 error=record not found trace=5a9a567b61b723bdfc6136ec158de571 span=cfd883a7dc7270b7
|
||||
282832-12-12 00:00:00.056 [31;1m error [0;22m [GORM] duration=0.3ms caller=middleware/authMiddleware.go:89 rows=0 error=record not found sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-17' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 trace=5a9a567b61b723bdfc6136ec158de571 span=cfd883a7dc7270b7
|
||||
282832-12-12 00:00:00.057 [31;1m error [0;22m [GORM] duration=0.7ms caller=middleware/authMiddleware.go:89 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-16' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 trace=5a9a567b61b723bdfc6136ec158de571 span=cfd883a7dc7270b7 rows=0 error=record not found
|
||||
282832-12-12 00:00:00.057 [31;1m error [0;22m [GORM] duration=0.5ms caller=middleware/authMiddleware.go:89 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-15' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 trace=5a9a567b61b723bdfc6136ec158de571 span=cfd883a7dc7270b7 rows=0 error=record not found
|
||||
282832-12-12 00:00:00.058 [31;1m error [0;22m [GORM] duration=0.4ms caller=middleware/authMiddleware.go:89 trace=5a9a567b61b723bdfc6136ec158de571 rows=0 span=cfd883a7dc7270b7 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-14' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 error=record not found
|
||||
282832-12-12 00:00:00.059 [31;1m error [0;22m [GORM] duration=1.1ms caller=middleware/authMiddleware.go:89 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-13' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 error=record not found span=cfd883a7dc7270b7 rows=0 trace=5a9a567b61b723bdfc6136ec158de571
|
||||
282832-12-12 00:00:00.060 [31;1m error [0;22m [GORM] duration=0.8ms caller=middleware/authMiddleware.go:89 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-12' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 rows=0 error=record not found trace=5a9a567b61b723bdfc6136ec158de571 span=cfd883a7dc7270b7
|
||||
282832-12-12 00:00:00.060 [31;1m error [0;22m [GORM] duration=0.5ms caller=middleware/authMiddleware.go:89 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-11' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 trace=5a9a567b61b723bdfc6136ec158de571 span=cfd883a7dc7270b7 rows=0 error=record not found
|
||||
282832-12-12 00:00:00.061 [31;1m error [0;22m [GORM] duration=0.3ms caller=middleware/authMiddleware.go:89 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-10' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 span=cfd883a7dc7270b7 rows=0 error=record not found trace=5a9a567b61b723bdfc6136ec158de571
|
||||
282832-12-12 00:00:00.061 [31;1m error [0;22m [GORM] duration=0.4ms caller=middleware/authMiddleware.go:89 trace=5a9a567b61b723bdfc6136ec158de571 span=cfd883a7dc7270b7 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-09' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 error=record not found rows=0
|
||||
282832-12-12 00:00:00.062 [31;1m error [0;22m [GORM] duration=1.0ms caller=middleware/authMiddleware.go:89 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-08' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 rows=0 error=record not found trace=5a9a567b61b723bdfc6136ec158de571 span=cfd883a7dc7270b7
|
||||
282832-12-12 00:00:00.062 [31;1m error [0;22m [GORM] duration=0.5ms caller=middleware/authMiddleware.go:89 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-07' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 rows=0 error=record not found trace=5a9a567b61b723bdfc6136ec158de571 span=cfd883a7dc7270b7
|
||||
282832-12-12 00:00:00.063 [31;1m error [0;22m [GORM] duration=0.4ms caller=middleware/authMiddleware.go:89 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-06' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 rows=0 span=cfd883a7dc7270b7 error=record not found trace=5a9a567b61b723bdfc6136ec158de571
|
||||
282832-12-12 00:00:00.063 [31;1m error [0;22m [GORM] duration=0.4ms caller=middleware/authMiddleware.go:89 trace=5a9a567b61b723bdfc6136ec158de571 span=cfd883a7dc7270b7 error=record not found sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-05' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 rows=0
|
||||
282832-12-12 00:00:00.064 [31;1m error [0;22m [GORM] duration=0.3ms caller=middleware/authMiddleware.go:89 rows=0 error=record not found trace=5a9a567b61b723bdfc6136ec158de571 span=cfd883a7dc7270b7 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-04' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1
|
||||
282832-12-12 00:00:00.064 [31;1m error [0;22m [GORM] duration=0.3ms caller=middleware/authMiddleware.go:89 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-03' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 rows=0 error=record not found span=cfd883a7dc7270b7 trace=5a9a567b61b723bdfc6136ec158de571
|
||||
282832-12-12 00:00:00.064 [31;1m error [0;22m [GORM] duration=0.2ms caller=middleware/authMiddleware.go:89 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-02' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 rows=0 error=record not found span=cfd883a7dc7270b7 trace=5a9a567b61b723bdfc6136ec158de571
|
||||
282832-12-12 00:00:00.064 [31;1m error [0;22m [GORM] duration=0.2ms caller=middleware/authMiddleware.go:89 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-01' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 trace=5a9a567b61b723bdfc6136ec158de571 rows=0 error=record not found span=cfd883a7dc7270b7
|
||||
292912-12-12 00:00:00.022 [31;1m error [0;22m [Init Telegram Config] New Bot API Error: {error Post "https://api.telegram.org/bot/getMe": dial tcp 74.86.17.48:443: i/o timeout} caller=initialize/telegram.go:39
|
||||
29298-12-12 00:00:00.788 [31;1m error [0;22m [GORM] duration=1.2ms caller=middleware/authMiddleware.go:89 span=4a4bcbad732bd00f sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-28' AND `type` = 40 ORDER BY `system_logs`.`id` LIMIT 1 rows=0 error=record not found trace=21179e3acc2b81d32df7625b94cb7031
|
||||
29298-12-12 00:00:00.790 [31;1m error [0;22m [GORM] duration=0.5ms caller=middleware/authMiddleware.go:89 error=record not found rows=0 trace=21179e3acc2b81d32df7625b94cb7031 span=4a4bcbad732bd00f sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-28' AND `type` = 41 ORDER BY `system_logs`.`id` LIMIT 1
|
||||
29298-12-12 00:00:00.792 [31;1m error [0;22m [GORM] duration=0.7ms caller=middleware/authMiddleware.go:89 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-28' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 error=record not found trace=21179e3acc2b81d32df7625b94cb7031 rows=0 span=4a4bcbad732bd00f
|
||||
29298-12-12 00:00:00.793 [31;1m error [0;22m [GORM] duration=0.5ms caller=middleware/authMiddleware.go:89 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-27' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 rows=0 error=record not found trace=21179e3acc2b81d32df7625b94cb7031 span=4a4bcbad732bd00f
|
||||
29298-12-12 00:00:00.793 [31;1m error [0;22m [GORM] duration=0.5ms caller=middleware/authMiddleware.go:89 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-26' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 trace=21179e3acc2b81d32df7625b94cb7031 rows=0 error=record not found span=4a4bcbad732bd00f
|
||||
29298-12-12 00:00:00.794 [31;1m error [0;22m [GORM] duration=0.8ms caller=middleware/authMiddleware.go:89 rows=0 error=record not found trace=21179e3acc2b81d32df7625b94cb7031 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-25' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 span=4a4bcbad732bd00f
|
||||
29298-12-12 00:00:00.795 [31;1m error [0;22m [GORM] duration=0.7ms caller=middleware/authMiddleware.go:89 trace=21179e3acc2b81d32df7625b94cb7031 span=4a4bcbad732bd00f sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-24' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 rows=0 error=record not found
|
||||
29298-12-12 00:00:00.796 [31;1m error [0;22m [GORM] duration=0.8ms caller=middleware/authMiddleware.go:89 rows=0 trace=21179e3acc2b81d32df7625b94cb7031 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-23' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 error=record not found span=4a4bcbad732bd00f
|
||||
29298-12-12 00:00:00.796 [31;1m error [0;22m [GORM] duration=0.5ms caller=middleware/authMiddleware.go:89 span=4a4bcbad732bd00f rows=0 error=record not found trace=21179e3acc2b81d32df7625b94cb7031 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-22' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1
|
||||
29298-12-12 00:00:00.797 [31;1m error [0;22m [GORM] duration=1.2ms caller=middleware/authMiddleware.go:89 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-21' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 trace=21179e3acc2b81d32df7625b94cb7031 rows=0 error=record not found span=4a4bcbad732bd00f
|
||||
29298-12-12 00:00:00.798 [31;1m error [0;22m [GORM] duration=0.4ms caller=middleware/authMiddleware.go:89 error=record not found sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-20' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 trace=21179e3acc2b81d32df7625b94cb7031 span=4a4bcbad732bd00f rows=0
|
||||
29298-12-12 00:00:00.798 [31;1m error [0;22m [GORM] duration=0.5ms caller=middleware/authMiddleware.go:89 error=record not found sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-19' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 rows=0 trace=21179e3acc2b81d32df7625b94cb7031 span=4a4bcbad732bd00f
|
||||
29298-12-12 00:00:00.799 [31;1m error [0;22m [GORM] duration=0.3ms caller=middleware/authMiddleware.go:89 rows=0 trace=21179e3acc2b81d32df7625b94cb7031 span=4a4bcbad732bd00f sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-18' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 error=record not found
|
||||
29298-12-12 00:00:00.799 [31;1m error [0;22m [GORM] duration=0.4ms caller=middleware/authMiddleware.go:89 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-17' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 rows=0 error=record not found trace=21179e3acc2b81d32df7625b94cb7031 span=4a4bcbad732bd00f
|
||||
29298-12-12 00:00:00.799 [31;1m error [0;22m [GORM] duration=0.4ms caller=middleware/authMiddleware.go:89 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-16' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 rows=0 error=record not found trace=21179e3acc2b81d32df7625b94cb7031 span=4a4bcbad732bd00f
|
||||
29298-12-12 00:00:00.800 [31;1m error [0;22m [GORM] duration=0.2ms caller=middleware/authMiddleware.go:89 rows=0 error=record not found sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-15' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 trace=21179e3acc2b81d32df7625b94cb7031 span=4a4bcbad732bd00f
|
||||
29298-12-12 00:00:00.800 [31;1m error [0;22m [GORM] duration=0.3ms caller=middleware/authMiddleware.go:89 rows=0 error=record not found span=4a4bcbad732bd00f sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-14' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 trace=21179e3acc2b81d32df7625b94cb7031
|
||||
29298-12-12 00:00:00.800 [31;1m error [0;22m [GORM] duration=0.4ms caller=middleware/authMiddleware.go:89 trace=21179e3acc2b81d32df7625b94cb7031 error=record not found span=4a4bcbad732bd00f sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-13' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 rows=0
|
||||
29298-12-12 00:00:00.801 [31;1m error [0;22m [GORM] duration=0.3ms caller=middleware/authMiddleware.go:89 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-12' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 rows=0 trace=21179e3acc2b81d32df7625b94cb7031 span=4a4bcbad732bd00f error=record not found
|
||||
29298-12-12 00:00:00.801 [31;1m error [0;22m [GORM] duration=0.4ms caller=middleware/authMiddleware.go:89 error=record not found trace=21179e3acc2b81d32df7625b94cb7031 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-11' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 rows=0 span=4a4bcbad732bd00f
|
||||
29298-12-12 00:00:00.802 [31;1m error [0;22m [GORM] duration=0.5ms caller=middleware/authMiddleware.go:89 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-10' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 rows=0 error=record not found trace=21179e3acc2b81d32df7625b94cb7031 span=4a4bcbad732bd00f
|
||||
29298-12-12 00:00:00.802 [31;1m error [0;22m [GORM] duration=0.4ms caller=middleware/authMiddleware.go:89 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-09' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 rows=0 span=4a4bcbad732bd00f error=record not found trace=21179e3acc2b81d32df7625b94cb7031
|
||||
29298-12-12 00:00:00.803 [31;1m error [0;22m [GORM] duration=0.4ms caller=middleware/authMiddleware.go:89 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-08' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 error=record not found span=4a4bcbad732bd00f rows=0 trace=21179e3acc2b81d32df7625b94cb7031
|
||||
29298-12-12 00:00:00.803 [31;1m error [0;22m [GORM] duration=0.5ms caller=middleware/authMiddleware.go:89 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-07' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 rows=0 span=4a4bcbad732bd00f error=record not found trace=21179e3acc2b81d32df7625b94cb7031
|
||||
29298-12-12 00:00:00.803 [31;1m error [0;22m [GORM] duration=0.4ms caller=middleware/authMiddleware.go:89 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-06' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 trace=21179e3acc2b81d32df7625b94cb7031 span=4a4bcbad732bd00f rows=0 error=record not found
|
||||
29298-12-12 00:00:00.804 [31;1m error [0;22m [GORM] duration=0.3ms caller=middleware/authMiddleware.go:89 span=4a4bcbad732bd00f sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-05' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 error=record not found rows=0 trace=21179e3acc2b81d32df7625b94cb7031
|
||||
29298-12-12 00:00:00.804 [31;1m error [0;22m [GORM] duration=0.5ms caller=middleware/authMiddleware.go:89 error=record not found span=4a4bcbad732bd00f sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-04' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 rows=0 trace=21179e3acc2b81d32df7625b94cb7031
|
||||
29298-12-12 00:00:00.805 [31;1m error [0;22m [GORM] duration=0.4ms caller=middleware/authMiddleware.go:89 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-03' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 error=record not found rows=0 trace=21179e3acc2b81d32df7625b94cb7031 span=4a4bcbad732bd00f
|
||||
29298-12-12 00:00:00.805 [31;1m error [0;22m [GORM] duration=0.3ms caller=middleware/authMiddleware.go:89 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-02' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 rows=0 error=record not found trace=21179e3acc2b81d32df7625b94cb7031 span=4a4bcbad732bd00f
|
||||
29298-12-12 00:00:00.805 [31;1m error [0;22m [GORM] duration=0.3ms caller=middleware/authMiddleware.go:89 sql=SELECT * FROM `system_logs` WHERE `date` = '2025-12-01' AND `type` = 42 ORDER BY `system_logs`.`id` LIMIT 1 trace=21179e3acc2b81d32df7625b94cb7031 span=4a4bcbad732bd00f rows=0 error=record not found
|
||||
|
||||
@@ -81,7 +81,10 @@ func (l *ActivateOrderLogic) ProcessTask(ctx context.Context, task *asynq.Task)
|
||||
return nil
|
||||
}
|
||||
|
||||
l.finalizeCouponAndOrder(ctx, orderInfo)
|
||||
if err := l.finalizeCouponAndOrder(ctx, orderInfo); err != nil {
|
||||
logger.WithContext(ctx).Error("[ActivateOrderLogic] Finalize order failed", logger.Field("error", err.Error()))
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -140,7 +143,7 @@ func (l *ActivateOrderLogic) processOrderByType(ctx context.Context, orderInfo *
|
||||
|
||||
// finalizeCouponAndOrder handles post-processing tasks including coupon updates
|
||||
// and order status finalization
|
||||
func (l *ActivateOrderLogic) finalizeCouponAndOrder(ctx context.Context, orderInfo *order.Order) {
|
||||
func (l *ActivateOrderLogic) finalizeCouponAndOrder(ctx context.Context, orderInfo *order.Order) error {
|
||||
// Update coupon if exists
|
||||
if orderInfo.Coupon != "" {
|
||||
if err := l.svc.CouponModel.UpdateCount(ctx, orderInfo.Coupon); err != nil {
|
||||
@@ -158,7 +161,9 @@ func (l *ActivateOrderLogic) finalizeCouponAndOrder(ctx context.Context, orderIn
|
||||
logger.Field("error", err.Error()),
|
||||
logger.Field("order_no", orderInfo.OrderNo),
|
||||
)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewPurchase handles new subscription purchase including user creation,
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
# 项目说明文档
|
||||
|
||||
## 1. 项目规划
|
||||
- [ ] 核心业务逻辑维护与Bug修复
|
||||
- [ ] 确保支付与订单流程闭环
|
||||
|
||||
## 2. 实施方案
|
||||
- **订单状态修复**:针对支付后订单状态未更新问题,完善异步任务的错误处理机制。
|
||||
|
||||
## 3. 进度记录
|
||||
- **2026-01-15 [已完成] 修复订单状态更新 Bug**
|
||||
- **问题描述**:用户支付成功后,订单状态停留在“已支付”,未流转到“已完成”,导致订阅未下发。
|
||||
- **原因分析**:`finalizeCouponAndOrder` 函数在更新数据库失败时仅打印日志未返回错误,导致 Asynq 消息队列误判任务成功,未触发重试机制。
|
||||
- **解决方案**:重构该函数及其调用方 `ProcessTask`,确保数据库更新错误能向上抛出,触发 Asynq 的自动重试策略。
|
||||
Reference in New Issue
Block a user