Initial import

This commit is contained in:
2026-01-18 00:53:18 +00:00
parent fb78291fb1
commit 940191502e
115 changed files with 15524 additions and 0 deletions

4583
backend/.done Executable file

File diff suppressed because it is too large Load Diff

39
backend/JobRunner Executable file
View File

@@ -0,0 +1,39 @@
#!/usr/bin/env php
<?php
$opts = getopt("c:j:");
$class = null;
$jobid = null;
if (array_key_exists("c", $opts)) {
$class = $opts['c'];
}
if (array_key_exists("j", $opts)) {
$jobid = $opts['j'];
}
require_once(__DIR__ . "/../app.php");
while (true) {
$job = Job::consumeNextJob($class);
if ($job) {
print("Executing job " . $job->jobID() . "\n");
try {
$job->run();
$job->finish();
} catch (PDOException $e) {
print_r($e);
$job->status($e->getMessage());
$job->fail();
} catch (Exception $e) {
print_r($e);
$job->status($e->get_message());
$job->fail();
}
print("Job finished\n");
} else {
sleep(1);
}
}