Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,4 @@ SENTRY_TRACES_SAMPLE_RATE=
CLOUDFLARE_TURNSTILE_SITE_KEY=
CLOUDFLARE_TURNSTILE_SECRET_KEY=
DATABASE_BACKUP_MAIL_TO_ADDRESS= spatie backup notification send mail.
DISCORD_WEBHOOK_URL= spatie discord notification

# Google Indexing API
GOOGLE_INDEXING_ENABLED=false
GOOGLE_INDEXING_SERVICE_ACCOUNT_KEY_PATH=storage/app/google/service-account.json
DISCORD_WEBHOOK_URL= spatie discord notification
158 changes: 0 additions & 158 deletions app/Console/Commands/GoogleIndexingSubmitUrl.php

This file was deleted.

67 changes: 0 additions & 67 deletions app/Jobs/SubmitUrlToGoogleIndexing.php

This file was deleted.

23 changes: 0 additions & 23 deletions app/Observers/JobListingObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use App\Caches\CountryAwareMostViewedJobsCache;
use App\Caches\CountryAwareJobPageCache;
use App\Caches\RelatedJobListingCache;
use App\Jobs\SubmitUrlToGoogleIndexing;
use App\Models\JobListing;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Str;
Expand All @@ -33,38 +32,16 @@ public function updating(JobListing $jobListing): void
public function created(JobListing $jobListing): void
{
$this->clearCache();
$this->submitToGoogleIndexing($jobListing, 'URL_UPDATED');
}

public function updated(JobListing $jobListing): void
{
$this->clearCache();
$this->submitToGoogleIndexing($jobListing, 'URL_UPDATED');
}

public function deleted(JobListing $jobListing): void
{
$this->clearCache();
$this->submitToGoogleIndexing($jobListing, 'URL_DELETED');
}

private function submitToGoogleIndexing(JobListing $jobListing, string $type): void
{
if (!config('services.google_indexing.enabled')) {
return;
}

try {
$url = route('job.show', $jobListing->slug);
SubmitUrlToGoogleIndexing::dispatch($url, $type);
} catch (\Exception $e) {
\Log::warning('Failed to dispatch Google Indexing job', [
'job_id' => $jobListing->id,
'slug' => $jobListing->slug,
'type' => $type,
'error' => $e->getMessage()
]);
}
}

protected function clearCache(): void
Expand Down
Loading