Просмотр исходного кода

Update AvatarSync, fix sync skipping recently fetched avatars by setting last_fetched_at to null before refetching

Daniel Supernault 2 лет назад
Родитель
Сommit
a83fc798b7
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      app/Console/Commands/AvatarSync.php

+ 3 - 1
app/Console/Commands/AvatarSync.php

@@ -212,7 +212,9 @@ class AvatarSync extends Command
 			->with('profile')
 			->chunk(10, function($avatars) {
 				foreach($avatars as $avatar) {
-					RemoteAvatarFetch::dispatch($avatar->profile);
+					$avatar->last_fetched_at = null;
+					$avatar->save();
+					RemoteAvatarFetch::dispatch($avatar->profile)->onQueue('low');
 				}
 		});
 	}