Re-enable the processing items checks
This commit is contained in:
@ -188,16 +188,16 @@ export function LibraryContainer(props: LibraryContainerProps): JSX.Element {
|
||||
.map((li) => li.node.id)
|
||||
}, [libraryItems])
|
||||
|
||||
// const refreshProcessingItems = useRefreshProcessingItems()
|
||||
const refreshProcessingItems = useRefreshProcessingItems()
|
||||
|
||||
// useEffect(() => {
|
||||
// if (processingItems.length) {
|
||||
// refreshProcessingItems.mutateAsync({
|
||||
// attempt: 0,
|
||||
// itemIds: processingItems,
|
||||
// })
|
||||
// }
|
||||
// }, [processingItems])
|
||||
useEffect(() => {
|
||||
if (processingItems.length) {
|
||||
refreshProcessingItems.mutateAsync({
|
||||
attempt: 0,
|
||||
itemIds: processingItems,
|
||||
})
|
||||
}
|
||||
}, [processingItems])
|
||||
|
||||
const focusFirstItem = useCallback(() => {
|
||||
if (libraryItems.length < 1) {
|
||||
|
||||
@ -676,6 +676,20 @@ export function useRefreshProcessingItems() {
|
||||
.map((it) => it.node.id)
|
||||
: variables.itemIds,
|
||||
})
|
||||
} else if (shouldRefetch) {
|
||||
console.log('failed for edges: ', data?.edges)
|
||||
// There are still processing items, but we've reached max attempts
|
||||
// so we will mark them as failed.
|
||||
for (const item of data?.edges ?? []) {
|
||||
if (item.node.state == State.PROCESSING) {
|
||||
updateItemStateInCache(
|
||||
queryClient,
|
||||
item.node.id,
|
||||
item.node.slug,
|
||||
State.FAILED
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user