Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bobimicroweber committed Jan 15, 2024
1 parent 946457c commit 441abe1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
13 changes: 8 additions & 5 deletions app/Console/Commands/TestBuild.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,19 @@ public function handle()
{
$this->info('Start job work...');

$getWaitingPackage = Package::where('id', 161)->first();
if ($getWaitingPackage == null) {
$getPackage = Package::where('id', 10)->first();
if ($getPackage == null) {
$this->error('No packages for processing. Time: ' . date('Y-m-d H:i:s'));
return 0;
}

$this->info('Package: ' . $getWaitingPackage->name);
$this->info('Package: ' . $getPackage->name);

$run = new ProcessPackageSatis($getWaitingPackage->id, $getWaitingPackage->name);
$run->handle();
$getPackage->clone_status = Package::CLONE_STATUS_WAITING;
$getPackage->save();

$run = new ProcessPackageSatis($getPackage->id, $getPackage->name);
$status = $run->handle();

$this->info('Job work done.');

Expand Down
5 changes: 4 additions & 1 deletion app/Jobs/ProcessPackageSatis.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ public function handle()
// job already running
$packageModel->clone_log = "Already running.";
$packageModel->save();
return;
return [
'status' => 'error',
'message' => 'Already running.'
];
}

$packageModel->clone_log = "Job is started.";
Expand Down
1 change: 1 addition & 0 deletions app/SatisPackageBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public static function build($file)
$shellCommand .= ' ' . $satisConfigFile;
$shellCommand .= ' ' . $satisRepositoryOutputPath;
$shellCommand .= ' > ' . $satisBuildLog;

exec($shellCommand);

$i = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public function up()
$table->timestamp('clone_queue_at')->nullable();
$table->longText('clone_log')->nullable();
$table->integer('is_cloned')->default(0)->nullable();
$table->integer('debug_count')->nullable();

$table->timestamps();
});
Expand Down

0 comments on commit 441abe1

Please sign in to comment.