Skip to content

Commit 048d48c

Browse files
rickbijkerkRick Bijkerk
andauthored
implement recovery from errors while loading trusted documents (#168)
Once an error occurred during the process of loading trusted docs it never unlocked the lock causing it to never re-load trusted documents again ( +added some logging about the error) --------- Co-authored-by: Rick Bijkerk <[email protected]>
1 parent 4dd647c commit 048d48c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/business/trusteddocuments/persisted_operations.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ func (p *Handler) Validate(validate func(operation string) gqlerror.List) []vali
270270
func (p *Handler) load(failureStrategy ReloadFailureStrategy) error {
271271
newState, err := p.loader.Load(context.Background())
272272
if err != nil {
273+
p.log.Error("error loading persisted operations", "err", err)
273274
loadingResultCounter.WithLabelValues(p.loader.Type(), "failure").Inc()
274275
if failureStrategy == ReloadFailureStrategyReject {
275276
return err
@@ -305,10 +306,10 @@ func (p *Handler) reloadProcessor() {
305306
continue
306307
}
307308
err := p.load(ReloadFailureStrategyReject)
309+
p.refreshLock.Unlock()
308310
if err != nil {
309311
continue
310312
}
311-
p.refreshLock.Unlock()
312313
}
313314
}
314315
}()

0 commit comments

Comments
 (0)