mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 14:31:26 +00:00
Update StatusDelete pipeline, dispatch async
This commit is contained in:
parent
7bcf3e0334
commit
257c094911
3 changed files with 8 additions and 5 deletions
|
@ -225,7 +225,7 @@ class StatusController extends Controller
|
|||
StatusService::del($status->id, true);
|
||||
if ($status->profile_id == $user->profile->id || $user->is_admin == true) {
|
||||
Cache::forget('profile:status_count:'.$status->profile_id);
|
||||
StatusDelete::dispatchNow($status);
|
||||
StatusDelete::dispatch($status);
|
||||
}
|
||||
|
||||
if($request->wantsJson()) {
|
||||
|
|
|
@ -41,7 +41,7 @@ class MediaDeletePipeline implements ShouldQueue
|
|||
array_pop($e);
|
||||
$i = implode('/', $e);
|
||||
|
||||
if(config('pixelfed.cloud_storage') == true) {
|
||||
if(config_cache('pixelfed.cloud_storage') == true) {
|
||||
$disk = Storage::disk(config('filesystems.cloud'));
|
||||
|
||||
if($path && $disk->exists($path)) {
|
||||
|
@ -63,9 +63,9 @@ class MediaDeletePipeline implements ShouldQueue
|
|||
$disk->delete($thumb);
|
||||
}
|
||||
|
||||
$media->forceDelete();
|
||||
$media->delete();
|
||||
|
||||
return;
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -50,6 +50,9 @@ class StatusDelete implements ShouldQueue
|
|||
*/
|
||||
public $deleteWhenMissingModels = true;
|
||||
|
||||
public $timeout = 900;
|
||||
public $tries = 2;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*
|
||||
|
@ -131,7 +134,7 @@ class StatusDelete implements ShouldQueue
|
|||
->where('item_id', $status->id)
|
||||
->delete();
|
||||
|
||||
$status->forceDelete();
|
||||
$status->delete();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue