@@ -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') {