Jobs Übersicht
Alle Queue Jobs in Postbox. Jobs werden über den database Queue-Driver verarbeitet und von dedizierten Forge-Workern konsumiert.
Location: app/Jobs/
Job-Tabelle
| Job | Queue | Tries | Timeout | Unique | Trigger | Beschreibung |
|---|---|---|---|---|---|---|
ImportWatcherFromUrl | imports-youtube | 3 (maxExceptions) | 7d retryUntil | Nein | ProcessWatcherImportRun | URL aufloesen, Profil erstellen, Watcher verknuepfen |
ProcessWatcherImportRun | imports-youtube | 1 | 300s | Nein | User-Import (Livewire) | Bulk-Import: dispatcht ImportWatcherFromUrl pro Item |
SyncYouTubeVideoStats | default | 5 (maxExceptions) | 600s | Ja | Scheduler / Admin | Video-Statistiken via Data API synchronisieren (Full-Sync, 24h retryUntil) |
FindRelatedYouTubeChannels | youtube-related-channels | 5 (maxExceptions) | 300s | Ja (2h) | User-Klick / Scheduler | Aehnliche YouTube-Kanaele via Search API finden |
ProcessPendingYouTubeImports | imports-youtube | 1 | 120s | Nein | Scheduler (5 min) | Quota-blockierte Channel-Imports nachverarbeiten |
RecalculateRelatedChannelScores | youtube-related-channels | 1 | 120s | Nein | ProcessPendingYouTubeImports | Relevance-Scores mit Subscriber-Daten neu berechnen |
ResolveRelatedChannelRelationship | youtube-related-channels | 5 | -- | Nein | FindRelatedYouTubeChannels | Einzelne Related-Channel-Beziehung auflösen |
FindRelatedInstagramProfiles | instagram-related-profiles | 3 | -- | Ja (1h) | User-Klick / Scheduler | Ähnliche Instagram-Profile via Keyword-Matching |
RecalculateRelatedInstagramScores | instagram-related-profiles | 1 | 120s | Nein | Recalculate Command | Relevance-Scores für Instagram Related neu berechnen |
FindCrossPlatformRelatedProfiles | cross-platform-related | 3 | -- | Ja (1h) | Scheduler / User-Klick | Cross-Platform Matching (YouTube <-> Instagram) |
DetectProfileLanguage | ai-detection | 3 | 24h retryUntil | Ja (24h) | Scheduler (15 min) | Sprache/Land/Kategorie/Keywords via Gemini AI erkennen |
RetryInactiveProfileScrape | profile-retry | 1 | 60s | Nein | profiles:retry-inactive | Deaktiviertes Profil erneut scrapen |
RefreshSocialProfile | default | -- | -- | Nein | Diverse | Profil-Daten via Scraper aktualisieren (nur YouTube) |
BuildOwnerDashboardSnapshots | default | -- | -- | Nein | Dashboard-View | Dashboard-Rollups für einen Owner berechnen |
ConsolidateTagChunk | default | 3 | 12h retryUntil | Nein | tags:consolidate | AI-gesteuerte Tag-Consolidation pro Chunk |
SendNotificationEmail | emails | 5 | -- | Ja | NotificationService | E-Mail senden (Quiet Hours, Flood Guard) |
TrackMatomoPageView | matomo | 5 | 15s | Nein | TrackPageView Middleware | Matomo Page View server-seitig tracken |
TrackMatomoEvent | matomo | 5 | 15s | Nein | Diverse | Matomo Custom Event tracken |
ImportContactLinkProfile | imports-youtube | 3 (maxExceptions) | 24h retryUntil | Ja (contact-link-{id}) | Admin-Approval | Kontaktlink → SocialProfile importieren, Watcher erstellen |
FetchNewYouTubeVideo | default | 3 | -- | Ja (10min) | WebSub / RSS | Einzelnes neues Video per Data API abrufen und speichern |
GenerateOgImageJob | og-images | 3 | 60s | Ja (10min) | og-images:generate | OG-Image via Browsershot generieren |
SanitizeProfileBatch | default | 1 | 60s | Nein | profiles:sanitize | Batch von Low-Value Profilen auto-deaktivieren |
EnsureProfileFromContactLink | profile-discovery | 3 | -- | Ja | social:discover-from-links | SocialProfile aus Contact-Link-Handle anlegen |
AssessDescriptionQuality | ai-detection | 3 | -- | Ja | ai:assess-quality | AI-Beschreibungsqualitaet bewerten (Score 1-10) |
TranslateProfileDescription | ai-detection | 3 | -- | Ja | ai:translate-descriptions | AI-Beschreibung in andere Sprachen uebersetzen |
ScheduleProfileRelatedCalculations | cross-platform-related | 1 | 60s | Ja | Import-Events | Related-Berechnungen nach Profil-Import planen |
Pipeline-Jobs (Bus::batch via pipeline:run)
| Job | Beschreibung |
|---|---|
CalculateProfileMetricsBatch | Score + Explore-Metriken fuer ein Profil-Batch berechnen |
BuildDailyRollupsBatch | Dashboard-Rollups pro Tag+Watcher-Range (NTILE 16, timeout 900s, tries 1, early abort bei 3 Chunk-Failures) |
BuildLeaderboardsJob | Workspace-Leaderboard-Snapshots erstellen |
BuildGlobalLeaderboardsJob | Globale Top/Flop-Listen erstellen |
CalculateTrendingScoresBatch | Trending-Scores fuer ein Profil-Batch berechnen |
RunPipelinePhase3 | Phase 3: Trending Flags, Videos, Categories, Tag Cache, Explorer Refresh (eigener Job fuer frischen Worker-Prozess) |
Queue-Worker (Forge)
Alle Worker laufen als Daemons auf dem Produktionsserver:
| Queue | Timeout | Tries | Beschreibung |
|---|---|---|---|
imports-youtube | 120s | 3 | YouTube Channel Updates |
imports-youtube-priority | 120s | 3 | Prioritäts-Updates (Leaderboard, PRO) |
imports-youtube-video | 120s | 3 | Video-Statistiken Sync |
imports-youtube-video-priority | 120s | 3 | Prioritäts-Video-Sync |
youtube-related-channels | 300s | 2 | Related Channels Discovery |
ai-detection | 60s | 3 | Gemini AI Detection (Rate-Limited: 15/min) |
# Beispiel Worker-Konfiguration
php8.4 artisan queue:work database --sleep=5 --daemon --quiet \
--timeout=120 --tries=3 --queue=imports-youtube
Collector-basierte Jobs
Instagram Daily Scrapes laufen nicht über Laravel Queues, sondern über das Collector-System:
- Browser-Extension least Jobs via
/api/collector/jobs/lease - Ergebnisse kommen via
/api/collector/jobs/{id}/completezurück - Verarbeitung durch
InstagramDailyScrapeProcessorService
Retry-Strategien
Exponential Backoff
Die meisten Jobs nutzen steigende Backoff-Intervalle:
// ImportWatcherFromUrl
public function backoff(): array
{
return [30, 120, 600]; // 30s, 2min, 10min
}
// DetectProfileLanguage
public array $backoff = [60, 300, 900]; // 1min, 5min, 15min
// ResolveRelatedChannelRelationship
public function backoff(): array
{
return [60, 300, 600, 1800, 3600]; // 1min bis 1h
}
maxExceptions vs. tries
ImportWatcherFromUrl nutzt maxExceptions statt tries, damit release() Aufrufe (z.B. bei Quota-Pause) nicht als Fehlversuche zählen:
public int $maxExceptions = 3;
public function retryUntil(): \DateTime
{
return now()->addDays(7); // 7 days allows multiple quota pauses
}
Rate Limiting
| Job | Middleware | Limit | Konfiguration |
|---|---|---|---|
DetectProfileLanguage | RateLimited('ai-detection') | 15/min | AI_ENHANCER_RATE_PER_MINUTE |
FindRelatedYouTubeChannels | RateLimited('youtube-research') | Konfigurierbar | postbox.youtube_research |
ConsolidateTagChunk | RateLimited('tag-consolidation') | Konfigurierbar | postbox.tag_consolidation |
Unique Jobs
Jobs mit ShouldBeUnique verhindern Duplikate in der Queue:
| Job | uniqueFor | uniqueId |
|---|---|---|
DetectProfileLanguage | 24h | detect-language-{profileId} |
FindRelatedInstagramProfiles | 1h | find-related-instagram-profiles-{profileId} |
FindRelatedYouTubeChannels | 2h | find-related-yt-{profileId} |
FindCrossPlatformRelatedProfiles | 1h | find-cross-platform-related-{profileId} |
SyncYouTubeVideoStats | -- | Default (profileId) |
SendNotificationEmail | -- | Default |
ImportContactLinkProfile | -- | contact-link-{id} |
FetchNewYouTubeVideo | 10min | Default (videoId) |
GenerateOgImageJob | -- | Default |
AssessDescriptionQuality | -- | Default (profileId) |
TranslateProfileDescription | -- | Default (profileId) |
ScheduleProfileRelatedCalculations | -- | Default (profileId) |