mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-04 09:28:11 +00:00
fixed job polling being killed prematurely
This commit is contained in:
1 parent
402a1603f0
commit
8e8a4dd45a
1 file changed
+5
-2
@@ -76,7 +76,7 @@ export default function useInferenceJobsPolling({
|
||||
const [keepAlive, keepAliveSet] = useState(!!user);
|
||||
|
||||
// if this interval value is state set by the server response, useInterval will adjust accordingly
|
||||
const interval = 2500;
|
||||
const interval = 1500;
|
||||
|
||||
// this is to acccomodate async session loading
|
||||
useEffect(() => {
|
||||
@@ -105,7 +105,10 @@ export default function useInferenceJobsPolling({
|
||||
) => {
|
||||
inferenceJobsSet(updatedJobs);
|
||||
byCategorySet(categoryMap);
|
||||
if (!updatedJobs.some(job => jobStateCanChange(job.jobState))) {
|
||||
if (
|
||||
updatedJobs.length &&
|
||||
!updatedJobs.some(job => jobStateCanChange(job.jobState))
|
||||
) {
|
||||
keepAliveSet(false);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user