mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 22:41:27 +00:00
Update RemotAvatarFetch, only dispatch jobs if cloud storage is enabled
This commit is contained in:
parent
5a116c7ae0
commit
4f40f6f5a1
2 changed files with 10 additions and 2 deletions
|
@ -51,6 +51,10 @@ class RemoteAvatarFetch implements ShouldQueue
|
||||||
{
|
{
|
||||||
$profile = $this->profile;
|
$profile = $this->profile;
|
||||||
|
|
||||||
|
if(config('pixelfed.cloud_storage') !== true) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
if($profile->domain == null || $profile->private_key) {
|
if($profile->domain == null || $profile->private_key) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -474,7 +474,9 @@ class Helpers {
|
||||||
$profile->webfinger = strtolower(Purify::clean($webfinger));
|
$profile->webfinger = strtolower(Purify::clean($webfinger));
|
||||||
$profile->last_fetched_at = now();
|
$profile->last_fetched_at = now();
|
||||||
$profile->save();
|
$profile->save();
|
||||||
|
if(config('pixelfed.cloud_storage') == true) {
|
||||||
RemoteAvatarFetch::dispatch($profile);
|
RemoteAvatarFetch::dispatch($profile);
|
||||||
|
}
|
||||||
return $profile;
|
return $profile;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -488,8 +490,10 @@ class Helpers {
|
||||||
$profile->sharedInbox = isset($res['endpoints']) && isset($res['endpoints']['sharedInbox']) && Helpers::validateUrl($res['endpoints']['sharedInbox']) ? $res['endpoints']['sharedInbox'] : null;
|
$profile->sharedInbox = isset($res['endpoints']) && isset($res['endpoints']['sharedInbox']) && Helpers::validateUrl($res['endpoints']['sharedInbox']) ? $res['endpoints']['sharedInbox'] : null;
|
||||||
$profile->save();
|
$profile->save();
|
||||||
}
|
}
|
||||||
|
if(config('pixelfed.cloud_storage') == true) {
|
||||||
RemoteAvatarFetch::dispatch($profile);
|
RemoteAvatarFetch::dispatch($profile);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return $profile;
|
return $profile;
|
||||||
});
|
});
|
||||||
return $profile;
|
return $profile;
|
||||||
|
|
Loading…
Reference in a new issue