fix(get-status): return error in case of cache retrieval failure
This commit is contained in:
parent
2cff0de4ac
commit
918f2b43de
2 changed files with 2 additions and 1 deletions
|
@ -8,6 +8,6 @@ export async function GET() {
|
|||
|
||||
return Response.json({ success: true, status: status || 'RUNNING' });
|
||||
} catch (error) {
|
||||
return Response.json({ success: false, status: 'RUNNING' });
|
||||
return Response.json({ success: false, status: 'ERROR', error });
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@ export const StatusProvider: React.FC<IProps> = ({ children }) => {
|
|||
// If previous was not running and current is running, we need to refresh the page
|
||||
if (status === 'RUNNING' && s.current !== 'RUNNING') {
|
||||
setPollStatus(false);
|
||||
router.push('/');
|
||||
router.refresh();
|
||||
}
|
||||
if (status === 'RUNNING') {
|
||||
|
|
Loading…
Add table
Reference in a new issue