Skip to content

Commit

Permalink
Merge pull request #253 from Tobeyw/dev-mindy
Browse files Browse the repository at this point in the history
add insertTime for daily job
  • Loading branch information
Tobeyw authored Jun 12, 2024
2 parents cecfb78 + b349134 commit cc4542f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
8 changes: 3 additions & 5 deletions neo3fura_http/biz/job/job.GetActiveAddresses.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package job

import (
"encoding/json"

"go.mongodb.org/mongo-driver/bson"
)

Expand Down Expand Up @@ -42,11 +43,8 @@ func (me T) GetActiveAddresses() error {
for _, item := range r1 {
r2[item["sender"].(string)] = true
}
var i = 0
for _, _ = range r2 {
i++
}
data := bson.M{"ActiveAddresses": i}

data := bson.M{"ActiveAddresses": len(r2), "insertTime": r0["blocktime"]}
_, err = me.Client.SaveJob(struct {
Collection string
Data bson.M
Expand Down
3 changes: 2 additions & 1 deletion neo3fura_http/biz/job/job.GetDailyTransactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package job

import (
"encoding/json"

"go.mongodb.org/mongo-driver/bson"
)

Expand Down Expand Up @@ -38,7 +39,7 @@ func (me T) GetDailyTransactions() error {
if err != nil {
return err
}
data := bson.M{"DailyTransactions": len(r1)}
data := bson.M{"DailyTransactions": len(r1), "insertTime": r0["blocktime"]}
_, err = me.Client.SaveJob(struct {
Collection string
Data bson.M
Expand Down
3 changes: 2 additions & 1 deletion neo3fura_http/biz/job/job.GetNewAddresses.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package job

import (
"encoding/json"

"go.mongodb.org/mongo-driver/bson"
)

Expand Down Expand Up @@ -34,7 +35,7 @@ func (me T) GetNewAddresses() error {
return err
}

data := bson.M{"NewAddresses": count}
data := bson.M{"NewAddresses": count, "insertTime": r0["blocktime"]}
_, err = me.Client.SaveJob(struct {
Collection string
Data bson.M
Expand Down
3 changes: 2 additions & 1 deletion neo3fura_http/biz/job/job.GetPopularTokens.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package job

import (
"encoding/json"

"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
Expand Down Expand Up @@ -77,7 +78,7 @@ func (me T) GetPopularTokens() error {
}
}

data := bson.M{"Populars": values}
data := bson.M{"Populars": values, "insertTime": r0["timestamp"]}
_, err = me.Client.SaveJob(struct {
Collection string
Data bson.M
Expand Down

0 comments on commit cc4542f

Please sign in to comment.