commit
28f6467bb7
@ -14,10 +14,13 @@ function handleTriggerExecutionResult($result, $stdout, $stderr, $originalRow, $
|
|||||||
if ($result !== 0) {
|
if ($result !== 0) {
|
||||||
// Update table error status and notify via Telegram if execution failed
|
// Update table error status and notify via Telegram if execution failed
|
||||||
updateTriggerError($tableName, $stderr);
|
updateTriggerError($tableName, $stderr);
|
||||||
} else {
|
} else {
|
||||||
// Decode the output from JSON to array
|
// Decode the output from JSON to array
|
||||||
$newRowValue = json_decode($stdout, true);
|
$newRowValue = json_decode($stdout, true);
|
||||||
|
|
||||||
|
// Ignore the hydrate columns
|
||||||
|
$newRowValue = array_filter($newRowValue, fn($k) => !str_ends_with($k, '_ref'), ARRAY_FILTER_USE_KEY);
|
||||||
|
|
||||||
if ($newRowValue === null) {
|
if ($newRowValue === null) {
|
||||||
updateTriggerError($tableName, 'Invalid JSON output from sandboxed execution.');
|
updateTriggerError($tableName, 'Invalid JSON output from sandboxed execution.');
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -85,7 +85,7 @@ function processActiveTable($activeTable) {
|
|||||||
|
|
||||||
ensureLastUpdatedColumnExists($Name);
|
ensureLastUpdatedColumnExists($Name);
|
||||||
|
|
||||||
$rowsToProcess = sql("SELECT * FROM $Name WHERE LastUpdated > '$LastUpdated'");
|
$rowsToProcess = sql_read_and_hydrate("SELECT * FROM $Name WHERE LastUpdated > '$LastUpdated'");
|
||||||
|
|
||||||
foreach ($rowsToProcess as $unprocessedRow) {
|
foreach ($rowsToProcess as $unprocessedRow) {
|
||||||
processTableRow($activeTable, $unprocessedRow);
|
processTableRow($activeTable, $unprocessedRow);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user