summaryrefslogtreecommitdiff
path: root/modules/caddytls/distributedstek/distributedstek.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/caddytls/distributedstek/distributedstek.go')
-rw-r--r--modules/caddytls/distributedstek/distributedstek.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/caddytls/distributedstek/distributedstek.go b/modules/caddytls/distributedstek/distributedstek.go
index f29db29..e76fc47 100644
--- a/modules/caddytls/distributedstek/distributedstek.go
+++ b/modules/caddytls/distributedstek/distributedstek.go
@@ -145,7 +145,12 @@ func (s *Provider) storeSTEK(dstek distributedSTEK) error {
// current STEK is outdated (NextRotation time is in the past),
// then it is rotated and persisted. The resulting STEK is returned.
func (s *Provider) getSTEK() (distributedSTEK, error) {
- s.storage.Lock(s.ctx, stekLockName)
+ err := s.storage.Lock(s.ctx, stekLockName)
+ if err != nil {
+ return distributedSTEK{}, fmt.Errorf("failed to acquire storage lock: %v", err)
+ }
+
+ //nolint:errcheck
defer s.storage.Unlock(stekLockName)
// load the current STEKs from storage