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:
@@ -13,6 +13,7 @@ use App\Models\AcademyLessonBlock;
|
||||
use App\Models\AcademyPromptPack;
|
||||
use App\Models\AcademyPromptTemplate;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Str;
|
||||
use Laravel\Cashier\Subscription;
|
||||
@@ -280,7 +281,9 @@ final class AcademyAccessService
|
||||
public function coursePayload(AcademyCourse $course, ?User $viewer, array $options = []): array
|
||||
{
|
||||
$progress = is_array($options['progress'] ?? null) ? $options['progress'] : null;
|
||||
$lessonCount = (int) ($course->lessons_count_cache ?: $course->courseLessons()->count());
|
||||
$lessonCount = $course->relationLoaded('courseLessons')
|
||||
? $course->courseLessons->count()
|
||||
: (int) $course->lessons_count_cache;
|
||||
|
||||
return [
|
||||
'id' => (int) $course->id,
|
||||
@@ -1089,7 +1092,13 @@ final class AcademyAccessService
|
||||
}
|
||||
|
||||
try {
|
||||
$exists = Storage::disk((string) config('uploads.object_storage.disk', 's3'))->exists($normalizedPath);
|
||||
$exists = (bool) Cache::remember(
|
||||
'academy:asset-exists:'.$cacheKey,
|
||||
3600,
|
||||
function () use ($normalizedPath): bool {
|
||||
return Storage::disk((string) config('uploads.object_storage.disk', 's3'))->exists($normalizedPath);
|
||||
},
|
||||
);
|
||||
} catch (\Throwable) {
|
||||
$exists = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user