• 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

86.67
/iznik-batch/app/Console/Commands/Integrations/SyncWhatJobsCommand.php
1
<?php
2

3
namespace App\Console\Commands\Integrations;
4

5
use App\Services\WhatJobsService;
6
use Illuminate\Console\Command;
7
use Illuminate\Support\Facades\Cache;
8
use Illuminate\Support\Facades\Log;
9

10
class SyncWhatJobsCommand extends Command
11
{
12
    protected $signature = 'integrations:sync-whatjobs
13
                            {--dry-run : Parse feeds and count jobs without writing to database}';
14

15
    protected $description = 'Sync WhatJobs job listings from XML feeds into the jobs table';
16

17
    public function handle(WhatJobsService $service): int
2✔
18
    {
19
        $dryRun = (bool) $this->option('dry-run');
2✔
20

21
        $lock = Cache::lock('sync-whatjobs', 3600);
2✔
22
        if (!$lock->get()) {
2✔
NEW
23
            $this->warn('Another integrations:sync-whatjobs is already running, skipping.');
×
NEW
24
            return self::SUCCESS;
×
25
        }
26

27
        try {
28
            if ($dryRun) {
2✔
29
                $this->info('[DRY RUN] Parsing WhatJobs feeds — no database changes will be made.');
1✔
30
            }
31

32
            Log::info('WhatJobs sync starting', ['dry_run' => $dryRun]);
2✔
33

34
            $result = $service->sync($dryRun);
2✔
35

36
            $prefix = $dryRun ? '[DRY RUN] Would insert' : 'Inserted';
2✔
37
            $this->info("$prefix {$result['inserted']} of {$result['total']} parsed jobs.");
2✔
38

39
            Log::info('WhatJobs sync command complete', $result);
2✔
40
        } finally {
41
            $lock->release();
2✔
42
        }
43

44
        return self::SUCCESS;
2✔
45
    }
46
}
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