mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 10:40:07 -04:00
[LockManager] Add isLockAcquisitionError
helper (#220067)
- Adds a small helper method for handling errors of type `LockAcquisitionError`. - Flips retry logic for `populateMissingSemanticTextFieldWithLock ` so we retry all errors except `LockAcquisitionError`
This commit is contained in:
parent
8e2800ca27
commit
c33c95e507
5 changed files with 17 additions and 12 deletions
|
@ -7,5 +7,5 @@
|
|||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
export { LockAcquisitionError } from './src/lock_manager_client';
|
||||
export { LockAcquisitionError, isLockAcquisitionError } from './src/lock_manager_client';
|
||||
export { LockManagerService } from './src/lock_manager_service';
|
||||
|
|
|
@ -269,6 +269,10 @@ export async function getLock({
|
|||
return lockManager.get();
|
||||
}
|
||||
|
||||
export function isLockAcquisitionError(error: unknown): error is LockAcquisitionError {
|
||||
return error instanceof LockAcquisitionError;
|
||||
}
|
||||
|
||||
export async function withLock<T>(
|
||||
{
|
||||
esClient,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue