From f40dd869a545d7350b401aee3f4cef6b2b3e7b8d Mon Sep 17 00:00:00 2001 From: Alex Shtin Date: Mon, 13 Feb 2023 18:13:16 -0800 Subject: [PATCH] Fix ExecutionTime rounding when using PostgreSQL --- common/persistence/sql/sqlplugin/postgresql/visibility.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/persistence/sql/sqlplugin/postgresql/visibility.go b/common/persistence/sql/sqlplugin/postgresql/visibility.go index ec3362d18a7..3db432497ae 100644 --- a/common/persistence/sql/sqlplugin/postgresql/visibility.go +++ b/common/persistence/sql/sqlplugin/postgresql/visibility.go @@ -137,6 +137,7 @@ func (pdb *db) InsertIntoVisibility( row *sqlplugin.VisibilityRow, ) (sql.Result, error) { row.StartTime = pdb.converter.ToPostgreSQLDateTime(row.StartTime) + row.ExecutionTime = pdb.converter.ToPostgreSQLDateTime(row.ExecutionTime) return pdb.conn.ExecContext(ctx, templateCreateWorkflowExecutionStarted, row.NamespaceID, @@ -160,6 +161,7 @@ func (pdb *db) ReplaceIntoVisibility( switch { case row.CloseTime != nil && row.HistoryLength != nil: row.StartTime = pdb.converter.ToPostgreSQLDateTime(row.StartTime) + row.ExecutionTime = pdb.converter.ToPostgreSQLDateTime(row.ExecutionTime) closeTime := pdb.converter.ToPostgreSQLDateTime(*row.CloseTime) return pdb.conn.ExecContext(ctx, templateCreateWorkflowExecutionClosed,