mirror of
https://github.com/coder/coder.git
synced 2026-10-16 14:48:56 +08:00
Before refreshing, the caller has to put a lease on the row to prevent any other replicas from trying to refresh using the same token. Callers unable to get a lease enter a holding pattern waiting for the results. Also use this same lease query to re-read the link. This more or less functions the same as the re-read we used to have after a refresh failure, except it also allows us to avoid making the failed request in the first place. The downside is that we have to refetch the link every time even if the caller just fetched it, but since we have to make a database call to set the lease anyway...
3 lines
146 B
SQL
3 lines
146 B
SQL
ALTER TABLE external_auth_links DROP COLUMN IF EXISTS refresh_lease_expires_at;
|
|
DROP FUNCTION IF EXISTS acquire_external_auth_link_refresh_lease;
|