migrate
migrate copied to clipboard
Fix sqlserver lock
Problem
When acquiring the sqlserver
lock, it fails immediately if the lock can't be acquired. When running multiple migrations concurrently, only one of them will succeed and the other ones will fail.
Solution
Wait for up to 10 seconds when acquiring the lock. This way it lets the other entity that has acquired the lock do its job first. This is consistent with what this library does for postgres
(though it waits indefinitely) and for mysql
.
Fixes https://github.com/golang-migrate/migrate/issues/253