Skip to content

Commit

Permalink
#918 TDBCron updated SQL to "Order By" to stop random test failure (#919
Browse files Browse the repository at this point in the history
)

I didn't think this was necessary because.... wouldn't the DB return the table in the order of insertion?

apparently, randomly, it switches rows unless explicitly ordered
  • Loading branch information
belisoful authored Apr 28, 2023
1 parent e4b6fc9 commit cfbd49a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion framework/Util/Cron/TDbCronModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ protected function ensureTasks($initConfigTasks = true)
$this->ensureTable();
$this->_taskRows = $this->_tasks = [];
$cmd = $this->getDbConnection()->createCommand(
"SELECT * FROM {$this->_tableName} WHERE active IS NOT NULL"
"SELECT * FROM {$this->_tableName} WHERE active IS NOT NULL ORDER BY tabuid"
);
$results = $cmd->query();

Expand Down

0 comments on commit cfbd49a

Please sign in to comment.