Only call time.Now() once

This commit is contained in:
ditatompel 2024-06-03 19:26:12 +07:00
parent a0ff254f55
commit 85f3169689
No known key found for this signature in database
GPG key ID: 31D3D06D77950979

View file

@ -170,6 +170,8 @@ func (r *MoneroRepo) ProcessJob(report ProbeReport, proberId int64) error {
return errors.New("Invalid node")
}
now := time.Now()
qInsertLog := `
INSERT INTO tbl_probe_log (
node_id,
@ -205,14 +207,13 @@ func (r *MoneroRepo) ProcessJob(report ProbeReport, proberId int64) error {
report.NodeInfo.DatabaseSize,
report.NodeInfo.Difficulty,
report.NodeInfo.EstimateFee,
time.Now().Unix(),
now.Unix(),
report.Message,
report.TookTime)
if err != nil {
return err
}
now := time.Now()
limitTs := now.AddDate(0, -1, 0).Unix()
nodeStats := struct {