[Fix] Internal cron scheduler blocking view responses
Internal cron is now triggered by an axios request from the frontend so it can truly run in a separate request. Fixes #167
This commit is contained in:
@@ -2,11 +2,35 @@
|
||||
// import AuthLayout from '@/layouts/auth/AuthSimpleLayout.vue';
|
||||
// import AuthLayout from '@/layouts/auth/AuthCardLayout.vue';
|
||||
import AuthLayout from '@/layouts/auth/AuthSplitLayout.vue';
|
||||
import { onMounted } from 'vue';
|
||||
import { usePage } from '@inertiajs/vue3'
|
||||
import axios from 'axios';
|
||||
|
||||
defineProps<{
|
||||
title?: string;
|
||||
description?: string;
|
||||
}>();
|
||||
const cron = usePage().props.cron
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
if (navigator.platform.toUpperCase().indexOf('MAC') >= 0) {
|
||||
document.body.classList.add('is-mac')
|
||||
}
|
||||
|
||||
if (cron) {
|
||||
triggerWebcron()
|
||||
}
|
||||
})
|
||||
|
||||
const triggerWebcron = async function () {
|
||||
await axios.get('/webcron')
|
||||
.catch(function (response) {
|
||||
if (response.status >= 400) {
|
||||
console.error(response)
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user