mirror of https://github.com/pixelfed/pixelfed.git
Update AP helpers, refactor post count decrement logic
This commit is contained in:
parent
ddf7f09ad4
commit
b81ae5773f
|
@ -22,9 +22,9 @@ use App\Notification;
|
|||
use App\Services\AccountService;
|
||||
use App\Services\NetworkTimelineService;
|
||||
use App\Services\StatusService;
|
||||
use App\Jobs\ProfilePipeline\DecrementPostCount;
|
||||
use App\Jobs\MediaPipeline\MediaDeletePipeline;
|
||||
use Cache;
|
||||
use App\Services\Account\AccountStatService;
|
||||
|
||||
class DeleteRemoteStatusPipeline implements ShouldQueue
|
||||
{
|
||||
|
@ -56,10 +56,7 @@ class DeleteRemoteStatusPipeline implements ShouldQueue
|
|||
{
|
||||
$status = $this->status;
|
||||
|
||||
if(AccountService::get($status->profile_id, true)) {
|
||||
DecrementPostCount::dispatch($status->profile_id)->onQueue('low');
|
||||
}
|
||||
|
||||
AccountStatService::decrementPostCount($status->profile_id);
|
||||
NetworkTimelineService::del($status->id);
|
||||
StatusService::del($status->id, true);
|
||||
Bookmark::whereStatusId($status->id)->delete();
|
||||
|
|
|
@ -39,8 +39,8 @@ use App\Services\AccountService;
|
|||
use App\Services\CollectionService;
|
||||
use App\Services\StatusService;
|
||||
use App\Jobs\MediaPipeline\MediaDeletePipeline;
|
||||
use App\Jobs\ProfilePipeline\DecrementPostCount;
|
||||
use App\Services\NotificationService;
|
||||
use App\Services\Account\AccountStatService;
|
||||
|
||||
class RemoteStatusDelete implements ShouldQueue, ShouldBeUniqueUntilProcessing
|
||||
{
|
||||
|
@ -109,9 +109,7 @@ class RemoteStatusDelete implements ShouldQueue, ShouldBeUniqueUntilProcessing
|
|||
}
|
||||
|
||||
StatusService::del($status->id, true);
|
||||
|
||||
DecrementPostCount::dispatch($status->profile_id)->onQueue('inbox');
|
||||
|
||||
AccountStatService::decrementPostCount($status->profile_id);
|
||||
return $this->unlinkRemoveMedia($status);
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,11 @@ class AccountStatService
|
|||
return Redis::zadd(self::REFRESH_CACHE_KEY, $pid, $pid);
|
||||
}
|
||||
|
||||
public static function decrementPostCount($pid)
|
||||
{
|
||||
return Redis::zadd(self::REFRESH_CACHE_KEY, $pid, $pid);
|
||||
}
|
||||
|
||||
public static function removeFromPostCount($pid)
|
||||
{
|
||||
return Redis::zrem(self::REFRESH_CACHE_KEY, $pid);
|
||||
|
|
|
@ -39,8 +39,6 @@ use App\Jobs\HomeFeedPipeline\FeedInsertRemotePipeline;
|
|||
use App\Util\Media\License;
|
||||
use App\Models\Poll;
|
||||
use Illuminate\Contracts\Cache\LockTimeoutException;
|
||||
use App\Jobs\ProfilePipeline\IncrementPostCount;
|
||||
use App\Jobs\ProfilePipeline\DecrementPostCount;
|
||||
use App\Services\DomainService;
|
||||
use App\Services\UserFilterService;
|
||||
use App\Services\Account\AccountStatService;
|
||||
|
|
|
@ -48,8 +48,6 @@ use App\Services\UserFilterService;
|
|||
use App\Services\NetworkTimelineService;
|
||||
use App\Models\Conversation;
|
||||
use App\Models\RemoteReport;
|
||||
use App\Jobs\ProfilePipeline\IncrementPostCount;
|
||||
use App\Jobs\ProfilePipeline\DecrementPostCount;
|
||||
use App\Jobs\HomeFeedPipeline\FeedRemoveRemotePipeline;
|
||||
|
||||
class Inbox
|
||||
|
|
Loading…
Reference in New Issue