Closed pteich closed 5 years ago
Awesome, that was quick. A little too quick, haha.
The storage interface is probably changing slightly, to just Lock instead of TryLock. It will work a little more like a distributed mutex in that sense. It should simplify your job and reduce some logic. I'm mobile right now but feel free to have a look at the only open PR on certmagic.
So, unfortunately, I think some changes will be needed soon but mostly small changes, and then we'll lock it in as soon as the next version of Caddy is released. We just want to get it right as soon as possible. :)
No prob @mholt . I'll hold my horses until you finish https://github.com/mholt/certmagic/pull/7 - in the meantime I follow your discussion there :D Just a Lock() / Unlock() makes my case indeed easier because this is exactly like Consul's distributed locks work out-of-the-box.
K, we're done -- have at it!
Thanks @mholt - I'm done too. 😄Should work now with your updated interface (at least my tests pass).
Cool! I don't foresee any major changes to that interface so I think we're good here.
This change is more or less a complete rewrite and implements the new certmagic.Storage interface. With this it can be used as an offical Caddy cluster plugin.