Update UnfollowPipeline, fix follower count cache bug

This commit is contained in:
Daniel Supernault 2024-04-06 03:29:17 -06:00
parent 858fcbf606
commit 6bdf73de4d
No known key found for this signature in database
GPG key ID: 23740873EE6F76A1

View file

@ -4,26 +4,25 @@ namespace App\Jobs\FollowPipeline;
use App\Follower; use App\Follower;
use App\FollowRequest; use App\FollowRequest;
use App\Jobs\HomeFeedPipeline\FeedUnfollowPipeline;
use App\Notification; use App\Notification;
use App\Profile; use App\Profile;
use App\Services\AccountService;
use App\Services\FollowerService;
use App\Services\NotificationService;
use Cache; use Cache;
use Illuminate\Bus\Queueable; use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable; use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels; use Illuminate\Queue\SerializesModels;
use Log;
use Illuminate\Support\Facades\Redis;
use App\Services\AccountService;
use App\Services\FollowerService;
use App\Services\NotificationService;
use App\Jobs\HomeFeedPipeline\FeedUnfollowPipeline;
class UnfollowPipeline implements ShouldQueue class UnfollowPipeline implements ShouldQueue
{ {
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
protected $actor; protected $actor;
protected $target; protected $target;
/** /**
@ -112,6 +111,8 @@ class UnfollowPipeline implements ShouldQueue
->whereFollowerId($actor) ->whereFollowerId($actor)
->delete(); ->delete();
return; AccountService::del($target);
AccountService::del($actor);
} }
} }