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

Freegle / Iznik / 11342

08 May 2026 02:47PM UTC coverage: 68.97% (-3.8%) from 72.761%
11342

push

circleci

web-flow
Merge pull request #403 from Freegle/feature/exports-migration

feat(batch): migrate exports.php to users:process-exports

9127 of 10554 branches covered (86.48%)

Branch coverage included in aggregate %.

400 of 452 new or added lines in 2 files covered. (88.5%)

12172 existing lines in 167 files now uncovered.

100855 of 148909 relevant lines covered (67.73%)

19.62 hits per line

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

35.0
/iznik-batch/app/Console/Commands/Message/UpdateSpatialIndexCommand.php
1
<?php
2

3
namespace App\Console\Commands\Message;
4

5
use App\Console\Concerns\PreventsOverlapping;
6
use App\Services\MessageSpatialService;
7
use App\Traits\GracefulShutdown;
8
use Illuminate\Console\Command;
9
use Illuminate\Support\Facades\Log;
10

11
class UpdateSpatialIndexCommand extends Command
12
{
13
    use PreventsOverlapping;
14
    use GracefulShutdown;
15

16
    protected $signature = 'messages:update-spatial-index
17
                            {--dry-run : Show what would be updated without making changes}';
18

19
    protected $description = 'Update the spatial index for recent messages';
20

21
    public function handle(MessageSpatialService $service): int
1✔
22
    {
23
        if (!$this->acquireLock()) {
1✔
24
            $this->info('Already running, exiting.');
×
25
            return Command::SUCCESS;
×
26
        }
27

28
        try {
29
            $dryRun = (bool) $this->option('dry-run');
1✔
30

31
            if ($dryRun) {
1✔
32
                $this->info('Dry run — counting changes but not writing.');
1✔
33
            } else {
UNCOV
34
                Log::info('Starting message spatial index update');
×
35
            }
36

37
            $stats = $service->updateSpatialIndex($dryRun);
1✔
38

UNCOV
39
            $verb = $dryRun ? 'would update' : 'updated';
×
UNCOV
40
            $this->info("{$verb} {$stats['total']} entries:");
×
UNCOV
41
            $this->line(sprintf('  upserted_recent:      %d', $stats['upserted_recent']));
×
UNCOV
42
            $this->line(sprintf('  outcomes_updated:     %d', $stats['outcomes_updated']));
×
UNCOV
43
            $this->line(sprintf('  removed_deleted:      %d', $stats['removed_deleted']));
×
UNCOV
44
            $this->line(sprintf('  removed_old:          %d', $stats['removed_old']));
×
UNCOV
45
            $this->line(sprintf('  removed_non_approved: %d', $stats['removed_non_approved']));
×
46

UNCOV
47
            if (!$dryRun) {
×
UNCOV
48
                Log::info('Message spatial index update complete', $stats);
×
49
            }
50

UNCOV
51
            return Command::SUCCESS;
×
52
        } finally {
53
            $this->releaseLock();
1✔
54
        }
55
    }
56
}
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