• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Freegle / Iznik / 11933

10 May 2026 06:13AM UTC coverage: 72.889% (+0.05%) from 72.843%
11933

push

circleci

web-flow
Merge pull request #405 from Freegle/feat/batch-migrate-non-email-jobs

feat(batch): migrate non-email cron scripts to Laravel artisan commands

13854 of 20887 branches covered (66.33%)

Branch coverage included in aggregate %.

789 of 1004 new or added lines in 21 files covered. (78.59%)

36 existing lines in 3 files now uncovered.

102807 of 139167 relevant lines covered (73.87%)

22.45 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.0
/iznik-batch/app/Console/Commands/Integrations/SyncRestartProjectCommand.php
1
<?php
2

3
namespace App\Console\Commands\Integrations;
4

5
use App\Services\RestartProjectService;
6
use Illuminate\Console\Command;
7
use Illuminate\Contracts\Cache\LockTimeoutException;
8
use Illuminate\Support\Facades\Cache;
9

10
class SyncRestartProjectCommand extends Command
11
{
12
    protected $signature = 'integrations:sync-restartproject
13
                            {--dry-run : Log what would change without writing to the database}';
14

15
    protected $description = 'Sync upcoming Restart Project repair events into community events';
16

17
    public function handle(RestartProjectService $service): int
10✔
18
    {
19
        $lock = Cache::lock('integrations:sync-restartproject', 3600);
10✔
20

21
        try {
22
            $lock->block(0);
10✔
NEW
23
        } catch (LockTimeoutException) {
×
NEW
24
            $this->warn('Another instance is already running.');
×
NEW
25
            return Command::SUCCESS;
×
26
        }
27

28
        try {
29
            $dryRun = (bool) $this->option('dry-run');
10✔
30
            $result = $service->sync($dryRun);
10✔
31

32
            $prefix = $dryRun ? '[DRY RUN] Would process' : 'Processed';
10✔
33
            $this->info("{$prefix} {$result['added']} new event(s), {$result['updated']} updated, {$result['deleted']} deleted.");
10✔
34
        } finally {
35
            $lock->release();
10✔
36
        }
37

38
        return Command::SUCCESS;
10✔
39
    }
40
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc