Skip to content

Commit

Permalink
Fix assignment of the StartedAt value in a3m activity
Browse files Browse the repository at this point in the history
  • Loading branch information
sevein committed Mar 28, 2024
1 parent c164edf commit 32ae4fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions internal/a3m/a3m.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package a3m

import (
context "context"
"database/sql"
"errors"
"fmt"
"time"
Expand Down Expand Up @@ -184,12 +185,15 @@ func savePreservationTasks(

for _, job := range jobs {
pt := datatypes.PreservationTask{
TaskID: job.Id,
Name: job.Name,
Status: jobStatusToPreservationTaskStatus[job.Status],
TaskID: job.Id,
Name: job.Name,
Status: jobStatusToPreservationTaskStatus[job.Status],
StartedAt: sql.NullTime{
Time: job.StartTime.AsTime(),
Valid: true,
},
PreservationActionID: paID,
}
pt.StartedAt.Time = job.StartTime.AsTime()
err := pkgsvc.CreatePreservationTask(ctx, &pt)
if err != nil {
telemetry.RecordError(span, err)
Expand Down
2 changes: 1 addition & 1 deletion internal/a3m/a3m_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func TestCreateAIPActivity(t *testing.T) {
Status: enums.PreservationTaskStatusDone,
StartedAt: sql.NullTime{
Time: time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC),
Valid: false,
Valid: true,
},
})

Expand Down

0 comments on commit 32ae4fb

Please sign in to comment.