Commit dfbf224a authored by 贾浩@五瓣科技's avatar 贾浩@五瓣科技

update

parent 2fbee294
...@@ -46,7 +46,7 @@ func (d *Dao) GetClaimedAmount(address string) (amt *decimal.Decimal, err error) ...@@ -46,7 +46,7 @@ func (d *Dao) GetClaimedAmount(address string) (amt *decimal.Decimal, err error)
Select("sum(claimed_amount) as claimed_amount"). Select("sum(claimed_amount) as claimed_amount").
Scan(amt).Error Scan(amt).Error
if err != nil { if err != nil {
if strings.Contains(err.Error(), "record not found") { if strings.Contains(err.Error(), "could not convert value '<nil>'") {
err = nil err = nil
} }
return return
......
...@@ -9,30 +9,33 @@ services: ...@@ -9,30 +9,33 @@ services:
ports: ports:
- "13306:3306" - "13306:3306"
volumes: volumes:
- ./data:/var/lib/mysql - ./data/claim-monitor/db:/var/lib/mysql
- ./mysql-conf.d:/etc/mysql/conf.d - ./conf/claim-monitor/db/conf.d:/etc/mysql/conf.d
environment: environment:
MYSQL_ROOT_PASSWORD: "XN2UARuys3zy4Oux" MYSQL_ROOT_PASSWORD: "XN2UARuys3zy4Oux"
MYSQL_DATABASE: "agi" MYSQL_DATABASE: "agi"
sync: sync:
image: docker.aigic.ai/caduceus/claim-monitor:v0.0.1 image: caduceus/claim-monitor:v0.0.1
depends_on: depends_on:
- db - db
volumes:
- ./conf/claim-monitor/config.toml:/config.toml
command: command:
- "/bin/sh" - "/bin/sh"
- "-c" - "-c"
- "/usr/bin/sync -c /config.toml" - "/usr/bin/sync -c /config.toml"
restart: restart:
unless-stopped unless-stopped
api: api:
image: docker.aigic.ai/caduceus/claim-monitor:v0.0.1 image: caduceus/claim-monitor:v0.0.1
ports: ports:
- "28080:8080" - "28080:8080"
depends_on: depends_on:
- db - db
- sync - sync
volumes:
- ./conf/claim-monitor/config.toml:/config.toml
command: command:
- "/bin/sh" - "/bin/sh"
- "-c" - "-c"
......
...@@ -16,6 +16,7 @@ func (srv *Service) GetRecord(address string, page, pageSize int) (resp *http.Ge ...@@ -16,6 +16,7 @@ func (srv *Service) GetRecord(address string, page, pageSize int) (resp *http.Ge
log.WithField("address", address).WithError(err).Error("failed to get contract") log.WithField("address", address).WithError(err).Error("failed to get contract")
return return
} }
resp.Records = make([]http.Record, 0)
ether := big.NewInt(1000000000000000000) ether := big.NewInt(1000000000000000000)
for _, record := range records { for _, record := range records {
amt, _ := big.NewFloat(0).Quo( amt, _ := big.NewFloat(0).Quo(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment