summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbt <bt@rctt.net>2026-06-04 19:33:04 +0200
committerbt <bt@rctt.net>2026-06-04 19:33:59 +0200
commitca657465e45584fa5d61ed77d58ac083c00a6655 (patch)
tree08bf57bdcef458c0a4dbe69b62ea5a18797f5171
parent6628f924ba4aefa8f8361ebc252fb225718359c2 (diff)
downloadsolec-ca657465e45584fa5d61ed77d58ac083c00a6655.tar.gz
solec-ca657465e45584fa5d61ed77d58ac083c00a6655.zip
[daemon] Fix milliseconds in messages historyv0.6.1main
-rw-r--r--storage/storage.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/storage/storage.go b/storage/storage.go
index 6455876..18a968d 100644
--- a/storage/storage.go
+++ b/storage/storage.go
@@ -36,7 +36,7 @@ func InitDb(path string) (*Database, error) {
func (db *Database) AddMessage(msg core.Message) (err error) {
_, err = db.Exec(
"INSERT INTO messages (source, target, timestamp, content) VALUES (?, ?, ?, ?);",
- msg.Source, msg.Target, msg.Timestamp.Unix(), msg.Content,
+ msg.Source, msg.Target, msg.Timestamp.UnixMilli(), msg.Content,
)
return err
@@ -84,7 +84,7 @@ func (db *Database) getHistory(rows *sql.Rows, err error) ([]core.Message, error
if err = rows.Scan(&msg.Source, &msg.Target, &timestamp, &msg.Content); err != nil {
return history, err
}
- msg.Timestamp = time.Unix(timestamp, 0)
+ msg.Timestamp = time.UnixMilli(timestamp)
history = append(history, msg)
}