Skip to content
This repository was archived by the owner on Sep 11, 2025. It is now read-only.

Commit 79f9878

Browse files
fix: use millisecond precision in timestamps (#892)
1 parent dfe5648 commit 79f9878

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- feat: "start" and "stop" are now mutation prefixes [#889](https://github.com/hypermodeinc/modus/pull/889)
99
- fix: start agents synchronously, and add examples setting data on start [#890](https://github.com/hypermodeinc/modus/pull/890)
1010
- fix: resolve deadlocks related to open inbound http connections [#891](https://github.com/hypermodeinc/modus/pull/891)
11+
- fix: use millisecond precision in timestamps [#892](https://github.com/hypermodeinc/modus/pull/892)
1112

1213
## 2025-06-10 - Runtime 0.18.0-alpha.6
1314

runtime/actors/subscriber.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func (a *subscriptionActor) Receive(rc *goakt.ReceiveContext) {
102102
event := &agentEvent{
103103
Name: msg.Name,
104104
Data: msg.Data,
105-
Timestamp: msg.Timestamp.AsTime().Format(time.RFC3339),
105+
Timestamp: msg.Timestamp.AsTime().Format(utils.TimeFormat),
106106
}
107107
if data, err := utils.JsonSerialize(event); err != nil {
108108
rc.Err(fmt.Errorf("failed to serialize agent event message: %w", err))

runtime/actors/wasmagent.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func (a *wasmAgentActor) saveState(ctx context.Context) error {
109109
Name: a.agentName,
110110
Status: a.status,
111111
Data: data,
112-
UpdatedAt: time.Now().UTC().Format(time.RFC3339),
112+
UpdatedAt: time.Now().UTC().Format(utils.TimeFormat),
113113
}); err != nil {
114114
return fmt.Errorf("error saving agent state to database: %w", err)
115115
}

runtime/db/agentstate.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func updateAgentStatusInModusDB(ctx context.Context, id string, status string) e
8383
}
8484

8585
state.Status = status
86-
state.UpdatedAt = time.Now().UTC().Format(time.RFC3339)
86+
state.UpdatedAt = time.Now().UTC().Format(utils.TimeFormat)
8787

8888
return writeAgentStateToModusDB(ctx, *state)
8989
}
@@ -179,7 +179,7 @@ func getAgentStateFromPostgresDB(ctx context.Context, id string) (*AgentState, e
179179
if err := row.Scan(&a.Id, &a.Name, &a.Status, &a.Data, &ts); err != nil {
180180
return fmt.Errorf("failed to get agent state: %w", err)
181181
}
182-
a.UpdatedAt = ts.UTC().Format(time.RFC3339)
182+
a.UpdatedAt = ts.UTC().Format(utils.TimeFormat)
183183
return nil
184184
})
185185

@@ -210,7 +210,7 @@ func queryActiveAgentsFromPostgresDB(ctx context.Context) ([]AgentState, error)
210210
if err := rows.Scan(&a.Id, &a.Name, &a.Status, &a.Data, &ts); err != nil {
211211
return err
212212
}
213-
a.UpdatedAt = ts.UTC().Format(time.RFC3339)
213+
a.UpdatedAt = ts.UTC().Format(utils.TimeFormat)
214214
results = append(results, a)
215215
}
216216
if err := rows.Err(); err != nil {

runtime/db/inferencehistory.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ func writeInferenceHistoryToModusDb(ctx context.Context, batch []inferenceHistor
375375
ModelHash: data.model.Hash(),
376376
Input: string(input),
377377
Output: string(output),
378-
StartedAt: data.start.Format(time.RFC3339),
378+
StartedAt: data.start.Format(utils.TimeFormat),
379379
DurationMs: data.end.Sub(data.start).Milliseconds(),
380380
Function: funcStr,
381381
Plugin: Plugin{

0 commit comments

Comments
 (0)