mirror of
https://github.com/graphql-hive/console
synced 2026-04-21 14:37:17 +00:00
fix: gracefully handle publish lock acquisition (#7687)
This commit is contained in:
parent
273b12543b
commit
c514e237da
2 changed files with 22 additions and 3 deletions
5
.changeset/happy-garlics-cross.md
Normal file
5
.changeset/happy-garlics-cross.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'hive': patch
|
||||
---
|
||||
|
||||
Gracefully handle error when publish lock acquisition fails for clients not supporting retries.
|
||||
|
|
@ -1298,10 +1298,24 @@ export class SchemaPublisher {
|
|||
},
|
||||
)
|
||||
.catch((error: unknown) => {
|
||||
if (error instanceof MutexResourceLockedError && input.supportsRetry === true) {
|
||||
if (error instanceof MutexResourceLockedError) {
|
||||
if (input.supportsRetry === true) {
|
||||
return {
|
||||
__typename: 'SchemaPublishRetry',
|
||||
reason: 'Another schema publish is currently in progress.',
|
||||
} satisfies PublishResult;
|
||||
}
|
||||
|
||||
return {
|
||||
__typename: 'SchemaPublishRetry',
|
||||
reason: 'Another schema publish is currently in progress.',
|
||||
__typename: 'SchemaPublishError',
|
||||
valid: false,
|
||||
changes: [],
|
||||
errors: [
|
||||
{
|
||||
message:
|
||||
'Another schema publish is currently in progress. Please retry the publish.',
|
||||
},
|
||||
],
|
||||
} satisfies PublishResult;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue