aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/data/put.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/data/put.go')
-rw-r--r--pkg/data/put.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/pkg/data/put.go b/pkg/data/put.go
index 98cb6ba..6631eb0 100644
--- a/pkg/data/put.go
+++ b/pkg/data/put.go
@@ -4,6 +4,7 @@ import (
"context"
"database/sql"
"fmt"
+ "time"
"github.com/jpappel/atlas/pkg/index"
)
@@ -66,6 +67,13 @@ func (p *Put) Insert(ctx context.Context) error {
return err
}
+ if _, err := p.tx.Exec("INSERT OR REPLACE INTO Info(key,value,updated) VALUES (?,?,?)",
+ "lastUpdate", "singlePut", time.Now().UTC().Unix(),
+ ); err != nil {
+ p.tx.Rollback()
+ return err
+ }
+
return p.tx.Commit()
}
@@ -86,6 +94,12 @@ func (p PutMany) Insert() error {
return fmt.Errorf("failed to insert authors: %v", err)
}
+ if _, err := p.db.ExecContext(p.ctx, "INSERT OR REPLACE INTO Info(key,value,updated) VALUES (?,?,?)",
+ "lastUpdate", "multiPut", time.Now().UTC().Unix(),
+ ); err != nil {
+ return err
+ }
+
return nil
}