Added migration, schdule and signing in

This commit is contained in:
2025-03-01 10:03:40 +01:00
parent db9d65f445
commit 7079206658
5 changed files with 234 additions and 5 deletions

View File

@ -21,25 +21,26 @@ class HellcaseJob extends BrowserJob implements ShouldBeUniqueUntilProcessing
{
private const STEAM_LOGIN_THRESHOLD = 5 * 60; // 5 minutes
private const APPROXIMATIVE_RUNNING_MINUTES = 2;
private const WEBSITE_URL = "https://hellcase.com";
private JobRun $jobRun;
public function __construct()
{
Log::info("Constructing HellcaseJob");
Log::info("Constructing " . self::class);
parent::__construct(2);
}
public function run(Browser $browser): ?JobRun
{
Log::info("Running HellcaseJob");
Log::info("Running " . self::class);
$this->jobRun = new JobRun([
"job_id" => $this->jobId,
"success" => false,
]);
$this->jobRun->save();
$browser->visit('https://hellcase.com');
$browser->visit(self::WEBSITE_URL);
$browser->waitForText("CASES", 30, true);
$this->removePopups($browser);
sleep(5);
@ -50,7 +51,7 @@ class HellcaseJob extends BrowserJob implements ShouldBeUniqueUntilProcessing
$this->jobRun->success = true;
$this->jobRun->save();
Log::info("HellcaseJob run ended");
Log::info(self::class . " run ended");
return $this->jobRun;
}
@ -61,7 +62,7 @@ class HellcaseJob extends BrowserJob implements ShouldBeUniqueUntilProcessing
public function runTest(Browser $browser): ?JobRun
{
try {
$browser->visit('https://hellcase.com');
$browser->visit(self::WEBSITE_URL);
$browser->waitForText("CASES", 30, true);
$this->removePopups($browser);
sleep(2);