Ship production optimization M1-M12.5A: queues, metrics, HTTP observability, and vector search reliability.
Keep similar-ai from tripping the global circuit on a lone URL 502, clamp Qdrant search to 100, and add Server-Timing plus slow-request logging. Studio shared props, Academy S3 exists caching, heat chunking, and Redis/scheduler hygiene stay in this rollout.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
use App\Models\Artwork;
|
||||
use App\Services\ArtworkStatsService;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
it('does not increment download stats when the original file is missing', function () {
|
||||
$artwork = Artwork::factory()->create([
|
||||
'is_public' => true,
|
||||
'is_approved' => true,
|
||||
'published_at' => now()->subDay(),
|
||||
'file_name' => 'missing-original.jpg',
|
||||
'file_ext' => 'jpg',
|
||||
'hash' => str_repeat('ab', 32),
|
||||
]);
|
||||
|
||||
$this->mock(ArtworkStatsService::class, function ($mock) {
|
||||
$mock->shouldReceive('incrementDownloads')->never();
|
||||
});
|
||||
|
||||
$this->get('/download/artwork/'.$artwork->id)->assertNotFound();
|
||||
|
||||
expect(DB::table('artwork_downloads')->where('artwork_id', $artwork->id)->count())->toBe(0);
|
||||
});
|
||||
Reference in New Issue
Block a user