Skip to content

Commit

Permalink
#2460 Thumbnails are no longer regenerated regardless of any other ru…
Browse files Browse the repository at this point in the history
…les after a certain timespan. It's not a very useful feature to pick up changes, just causes issues.
  • Loading branch information
Wotuu committed Dec 30, 2024
1 parent 29b82d5 commit 899008c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
3 changes: 1 addition & 2 deletions app/Jobs/ProcessRouteFloorThumbnail.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ public function handle(): void
if ((int)config('keystoneguru.thumbnail.max_attempts') > $this->attempts) {
// Give some additional space since we're refreshing ALL floors - the first floor may get processed,
// but the floors after that will otherwise think "oh the thumbnail is up-to-date" and not refresh.
if ($this->dungeonRoute->thumbnail_updated_at->isBefore($this->dungeonRoute->updated_at->addHour()) ||
$this->dungeonRoute->thumbnail_updated_at->addDays(config('keystoneguru.thumbnail.refresh_anyways_days'))->isPast()) {
if ($this->dungeonRoute->thumbnail_updated_at->isBefore($this->dungeonRoute->updated_at->addHour())) {
$result = $this->thumbnailService->createThumbnail($this->dungeonRoute, $this->floorIndex, $this->attempts);

if (!$result) {
Expand Down
6 changes: 2 additions & 4 deletions app/Service/DungeonRoute/DungeonRouteService.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,8 @@ public function refreshOutdatedThumbnails(): int
})
->where(static function (Builder $builder) {
// Only if it's not already queued!
$builder->where(static function (Builder $builder) {
$builder->whereColumn('updated_at', '>', 'thumbnail_updated_at')
->whereDate('updated_at', '<', now()->subMinutes(config('keystoneguru.thumbnail.refresh_min')));
})->orWhereDate('thumbnail_updated_at', '<', now()->subDays(config('keystoneguru.thumbnail.refresh_anyways_days')));
$builder->whereColumn('updated_at', '>', 'thumbnail_updated_at')
->whereDate('updated_at', '<', now()->subMinutes(config('keystoneguru.thumbnail.refresh_min')));
})
// Published routes get priority! This is only really relevant initially while processing the thumbnail queue
->orderBy('published_state_id', 'desc')
Expand Down
5 changes: 0 additions & 5 deletions config/keystoneguru.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,6 @@
*/
'refresh_min' => 30,

/**
* The amount of days when the thumbnail gets refreshed anyway regardless of other rules.
*/
'refresh_anyways_days' => 180,

/**
* The amount of hours when a thumbnail refresh must be in the queue for before it is re-queued
*/
Expand Down

0 comments on commit 899008c

Please sign in to comment.