Skip to content

Commit 8bd98fc

Browse files
committed
fix
1 parent c48821f commit 8bd98fc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

dbos/system_database.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,11 +1568,11 @@ func (s *sysDB) sleep(ctx context.Context, input sleepInput) (time.Duration, err
15681568
}
15691569

15701570
// The output should be a time.Time representing the end time
1571-
endTimeInterface, ok := recordedResult.output.(time.Time)
1572-
if !ok {
1573-
return 0, fmt.Errorf("recorded output is not a time.Time: %T", recordedResult.output)
1571+
// Because checkOperationExecution decoded it in an `any` type, we need to encode/decode it into a time.Time
1572+
endTime, err = convertJSONToType[time.Time](recordedResult.output)
1573+
if err != nil {
1574+
return 0, fmt.Errorf("failed to convert recorded output to time.Time: %w", err)
15741575
}
1575-
endTime = endTimeInterface
15761576

15771577
if recordedResult.err != nil { // This should never happen
15781578
return 0, recordedResult.err

0 commit comments

Comments
 (0)