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

Freegle / Iznik / 20959

13 Jun 2026 02:43PM UTC coverage: 71.021% (+1.5%) from 69.555%
20959

push

circleci

edwh
feat(web): redirect /councils to /partnerships

The councils content now lives at /partnerships; add a route rule so the old
/councils URL (which 404'd) redirects there.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

10705 of 14260 branches covered (75.07%)

Branch coverage included in aggregate %.

116833 of 165317 relevant lines covered (70.67%)

35.88 hits per line

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

87.5
/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
        // The WhatJobs XML feed currently parses ~180k jobs into memory
22
        // before insertJobs() flushes them in chunks (parseFeed builds the
23
        // full $jobs[] array and returns it). At PHP's default 512M, this
24
        // tips into a FatalError as soon as the second (clickcast) feed is
25
        // merged in. Raise the ceiling here so the run completes; the
26
        // longer-term fix is to convert parseFeed to a generator and stream
27
        // straight into insertJobs (TODO tracked in the service).
28
        ini_set('memory_limit', '1536M');
2✔
29

30
        // TTL matches the every-3-hours schedule (routes/console.php) plus
31
        // a comfortable margin: a cold-cache run that hits Photon for every
32
        // distinct city tuple can run for hours, far longer than the prior
33
        // 1h TTL.
34
        $lock = Cache::lock('sync-whatjobs', 4 * 3600);
2✔
35
        if (!$lock->get()) {
2✔
36
            $this->warn('Another integrations:sync-whatjobs is already running, skipping.');
×
37
            return self::SUCCESS;
×
38
        }
39

40
        try {
41
            if ($dryRun) {
2✔
42
                $this->info('[DRY RUN] Parsing WhatJobs feeds — no database changes will be made.');
1✔
43
            }
44

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

47
            $result = $service->sync($dryRun);
2✔
48

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

52
            Log::info('WhatJobs sync command complete', $result);
2✔
53
        } finally {
54
            $lock->release();
2✔
55
        }
56

57
        return self::SUCCESS;
2✔
58
    }
59
}
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