Skip to content

Commit 4be7b4f

Browse files
committed
chore(backup): make StartedAt and CompletedAt pointer variables
1 parent dda8e60 commit 4be7b4f

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

backup/client.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ type Client struct {
2020
}
2121

2222
type Info struct {
23-
Backend string // Backup storage backend
24-
ID string // Backup ID
25-
Path string // Path to backup in the backend storage
26-
Error string // Backup creation / restoration error.
27-
Status Status // Backup creation / restoration status.
28-
StartedAt time.Time // Time at which the backup creation started.
23+
Backend string // Backup storage backend
24+
ID string // Backup ID
25+
Path string // Path to backup in the backend storage
26+
Error string // Backup creation / restoration error.
27+
Status Status // Backup creation / restoration status.
28+
29+
StartedAt *time.Time // Time at which the backup creation started.
2930
CompletedAt *time.Time // Time at which the backup was completed, successfully or otherwise.
3031

3132
// IncludesCollections is always empty for backups that are still being created.

backup/client_test.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ func TestClient_Create(t *testing.T) {
5959
ID: "bak-1",
6060
Path: "/path/to/backup",
6161
Status: api.BackupStatusStarted,
62-
StartedAt: testkit.Now,
6362
IncludesCollections: []string{"Songs"},
6463
},
6564
},
@@ -69,7 +68,6 @@ func TestClient_Create(t *testing.T) {
6968
ID: "bak-1",
7069
Path: "/path/to/backup",
7170
Status: backup.StatusStarted,
72-
StartedAt: testkit.Now,
7371
IncludesCollections: []string{"Songs"},
7472
},
7573
},
@@ -138,8 +136,6 @@ func TestClient_Restore(t *testing.T) {
138136
ID: "bak-1",
139137
Path: "/path/to/backup",
140138
Status: api.BackupStatusSuccess,
141-
StartedAt: testkit.Now,
142-
CompletedAt: testkit.Ptr(testkit.Now),
143139
IncludesCollections: []string{"Songs"},
144140
SizeGiB: testkit.Ptr[float32](.6),
145141
},
@@ -150,8 +146,6 @@ func TestClient_Restore(t *testing.T) {
150146
ID: "bak-1",
151147
Path: "/path/to/backup",
152148
Status: backup.StatusSuccess,
153-
StartedAt: testkit.Now,
154-
CompletedAt: testkit.Ptr(testkit.Now),
155149
IncludesCollections: []string{"Songs"},
156150
SizeGiB: testkit.Ptr[float32](.6),
157151
},

0 commit comments

Comments
 (0)