Version 5.0.0 beta 4

This commit is contained in:
Neo committed 2025-12-19 16:57:00 -08:00
1 parent e86153356a
commit 2f24f9de48
276 files changed
+8614 -6044

No files matched your search

+9 -2
View File
@@ -26,6 +26,7 @@ use function is_array;
use function is_null;
use function strlen;
use function substr;
use function time;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
@@ -255,12 +256,18 @@ class Task extends ActiveRecord
public static function queued(): ?Task
{
$fifteenMinutesAgo = ( time() - 900 );
foreach (Db::i()->select( '*', 'core_tasks', array( 'next_run<? AND enabled=1', ( time() + 60 ) ), 'next_run ASC', NULL, NULL, NULL, Db::SELECT_FROM_WRITE_SERVER ) as $task )
$enabledApps = [];
foreach( Application::enabledApplications() as $app )
{
$enabledApps[] = $app->directory;
}
foreach (Db::i()->select( '*', 'core_tasks', array( [ 'next_run<?', ( time() + 60 ) ], [ 'enabled=1' ], [ Db::i()->in( 'app', $enabledApps ) ] ), 'next_run ASC', NULL, NULL, NULL, Db::SELECT_FROM_WRITE_SERVER ) as $task )
{
try
{
$task = static::constructFromData( $task );
if ( !$task->running or $task->next_run < $fifteenMinutesAgo )
{
if ( $task->running )