forked from mirror/pixelfed
commit
c62bfdba47
1 changed files with 18 additions and 21 deletions
|
@ -667,7 +667,7 @@ class Helpers {
|
|||
}
|
||||
$hash = base64_encode($url);
|
||||
$key = 'ap:profile:by_url:' . $hash;
|
||||
$ttl = now()->addMinutes(5);
|
||||
$ttl = now()->addSeconds(60);
|
||||
$profile = Cache::remember($key, $ttl, function() use($url, $runJobs) {
|
||||
$host = parse_url($url, PHP_URL_HOST);
|
||||
$local = config('pixelfed.domain.app') == $host ? true : false;
|
||||
|
@ -706,9 +706,7 @@ class Helpers {
|
|||
if($instance->wasRecentlyCreated == true) {
|
||||
\App\Jobs\InstancePipeline\FetchNodeinfoPipeline::dispatch($instance)->onQueue('low');
|
||||
}
|
||||
$profileLockKey = 'helpers:profile-lock:' . hash('sha256', $res['id']);
|
||||
$profile = Cache::lock($profileLockKey)->get(function () use($domain, $webfinger, $res, $runJobs) {
|
||||
return DB::transaction(function() use($domain, $webfinger, $res, $runJobs) {
|
||||
$profile = DB::transaction(function() use($domain, $webfinger, $res, $runJobs) {
|
||||
$profile = new Profile();
|
||||
$profile->domain = strtolower($domain);
|
||||
$profile->username = Purify::clean($webfinger);
|
||||
|
@ -726,7 +724,6 @@ class Helpers {
|
|||
RemoteAvatarFetch::dispatch($profile);
|
||||
return $profile;
|
||||
});
|
||||
});
|
||||
} else {
|
||||
// Update info after 24 hours
|
||||
if($profile->last_fetched_at == null ||
|
||||
|
|
Loading…
Reference in a new issue