mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 08:13:16 +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);
|
StatusService::del($status->id, true);
|
||||||
if ($status->profile_id == $user->profile->id || $user->is_admin == true) {
|
if ($status->profile_id == $user->profile->id || $user->is_admin == true) {
|
||||||
Cache::forget('profile:status_count:'.$status->profile_id);
|
Cache::forget('profile:status_count:'.$status->profile_id);
|
||||||
StatusDelete::dispatchNow($status);
|
StatusDelete::dispatch($status);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($request->wantsJson()) {
|
if($request->wantsJson()) {
|
||||||
|
|
|
@ -41,7 +41,7 @@ class MediaDeletePipeline implements ShouldQueue
|
||||||
array_pop($e);
|
array_pop($e);
|
||||||
$i = implode('/', $e);
|
$i = implode('/', $e);
|
||||||
|
|
||||||
if(config('pixelfed.cloud_storage') == true) {
|
if(config_cache('pixelfed.cloud_storage') == true) {
|
||||||
$disk = Storage::disk(config('filesystems.cloud'));
|
$disk = Storage::disk(config('filesystems.cloud'));
|
||||||
|
|
||||||
if($path && $disk->exists($path)) {
|
if($path && $disk->exists($path)) {
|
||||||
|
@ -63,9 +63,9 @@ class MediaDeletePipeline implements ShouldQueue
|
||||||
$disk->delete($thumb);
|
$disk->delete($thumb);
|
||||||
}
|
}
|
||||||
|
|
||||||
$media->forceDelete();
|
$media->delete();
|
||||||
|
|
||||||
return;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,6 +50,9 @@ class StatusDelete implements ShouldQueue
|
||||||
*/
|
*/
|
||||||
public $deleteWhenMissingModels = true;
|
public $deleteWhenMissingModels = true;
|
||||||
|
|
||||||
|
public $timeout = 900;
|
||||||
|
public $tries = 2;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new job instance.
|
* Create a new job instance.
|
||||||
*
|
*
|
||||||
|
@ -131,7 +134,7 @@ class StatusDelete implements ShouldQueue
|
||||||
->where('item_id', $status->id)
|
->where('item_id', $status->id)
|
||||||
->delete();
|
->delete();
|
||||||
|
|
||||||
$status->forceDelete();
|
$status->delete();
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue