refactor(coderd/database): split Time and Now into dbtime package (#9482)

Ref: #9380
This commit is contained in:
Mathias Fredriksson
2023-09-01 16:50:12 +00:00
committed by GitHub
parent 702b064cac
commit 19d7da3d24
89 changed files with 466 additions and 390 deletions
+2 -2
View File
@@ -14,7 +14,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/coder/coder/v2/coderd/coderdtest"
"github.com/coder/coder/v2/coderd/database"
"github.com/coder/coder/v2/coderd/database/dbtime"
"github.com/coder/coder/v2/coderd/workspaceapps"
"github.com/coder/coder/v2/cryptorand"
)
@@ -467,7 +467,7 @@ func TestAPIKeyEncryption(t *testing.T) {
key := genAPIKey(t)
encrypted, err := coderdtest.AppSecurityKey.EncryptAPIKey(workspaceapps.EncryptedAPIKeyPayload{
APIKey: key,
ExpiresAt: database.Now().Add(-1 * time.Hour),
ExpiresAt: dbtime.Now().Add(-1 * time.Hour),
})
require.NoError(t, err)