diff --git a/app/task/svc/svc_egg_energy_auto_record_price.go b/app/task/svc/svc_egg_energy_auto_record_price.go index e1bdfb4..183a7f9 100644 --- a/app/task/svc/svc_egg_energy_auto_record_price.go +++ b/app/task/svc/svc_egg_energy_auto_record_price.go @@ -46,6 +46,7 @@ func EggEnergyAutoRecordPrices(engine *xorm.Engine) { } if lastPrice.Date == dateNowStr && lastPrice.Hour == hourNowStr { + return // 3. 当前时间已经有记录 更新价格 lastPrice.Price = eggEnergyCoreData.NowPrice _, err2 := priceDb.EggEnergyPriceUpdate(lastPrice) diff --git a/etc/cfg.yml b/etc/cfg.yml index 1ecd30e..0db3792 100644 --- a/etc/cfg.yml +++ b/etc/cfg.yml @@ -9,23 +9,59 @@ srv_addr: ':4001' redis_addr: '127.0.0.1:6379' redis_password: '' +#db: +# host: '119.23.182.117:3306' +# name: 'egg' +# user: 'root' +# psw: 'Fnuo123com@' +# show_log: true +# max_lifetime: 30 +# max_open_conns: 100 +# max_idle_conns: 100 +# path: 'tmp/%s.log' db: - host: '119.23.182.117:3306' + host: 'advertisement-db.rwlb.rds.aliyuncs.com:3306' name: 'egg' - user: 'root' - psw: 'Fnuo123com@' + user: 'canal' + psw: 'DengBiao@1997' show_log: true max_lifetime: 30 max_open_conns: 100 max_idle_conns: 100 path: 'tmp/%s.log' +#db_back: +# host: '119.23.182.117:3306' +# name: 'egg-data-back-up' +# user: 'root' +# psw: 'Fnuo123com@' +# show_log: true +# path: 'tmp/%s.log' + +db_back: + host: 'advertisement-db.rwlb.rds.aliyuncs.com:3306' + name: 'egg-data-back-up' + user: 'canal' + psw: 'DengBiao@1997' + show_log: true + path: 'tmp/%s.log' + +#im_db: +# host: '119.23.182.117:3306' +# name: 'egg-im' +# user: 'root' +# psw: 'Fnuo123com@' +# show_log: true +# max_lifetime: 30 +# max_open_conns: 100 +# max_idle_conns: 100 +# path: 'tmp/%s.log' im_db: - host: '119.23.182.117:3306' + host: 'advertisement-db.rwlb.rds.aliyuncs.com:3306' name: 'egg-im' - user: 'root' - psw: 'Fnuo123com@' + user: 'canal' + psw: 'DengBiao@1997' show_log: true max_lifetime: 30 max_open_conns: 100