Handle server time outages as soft pauses
Deploy / Test, build and deploy (push) Successful in 2m14s

This commit is contained in:
2026-06-18 05:06:45 +04:00
parent 7baa7395af
commit 55e897909d
3 changed files with 98 additions and 5 deletions
+4
View File
@@ -43,6 +43,7 @@ type FakeGateway struct {
Portfolio domain.Portfolio
Operations []domain.Operation
ServerTime time.Time
ServerTimeError error
}
func NewFakeGateway() *FakeGateway {
@@ -239,6 +240,9 @@ func (f *FakeGateway) GetOperations(_ context.Context, _ string, from, to time.T
func (f *FakeGateway) GetServerTime(context.Context) (time.Time, error) {
f.mu.Lock()
defer f.mu.Unlock()
if f.ServerTimeError != nil {
return time.Time{}, f.ServerTimeError
}
if f.ServerTime.IsZero() {
return time.Now().UTC(), nil
}