Function
pgLocks
(shardIdsMap: Map<number, string>)
Source from the content-addressed store, hash-verified
| 560 | } |
| 561 | |
| 562 | const pgLocks = (shardIdsMap: Map<number, string>) => |
| 563 | Array.from( |
| 564 | shardIdsMap.entries(), |
| 565 | ([lockNum, shardId]) => `pg_try_advisory_lock(${pgLockNamespace}, ${lockNum}) AS "${shardId}"` |
| 566 | ).join(", ") |
| 567 | |
| 568 | const mysqlLocks = (shardIds: ReadonlyArray<string>) => |
| 569 | shardIds.map((shardId) => `GET_LOCK('${lockNames.get(shardId)!}', 0) AS "${shardId}"`).join(", ") |
Tested by
no test coverage detected