mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-25 17:26:43 +00:00
Update AdminInstanceController, remove db transaction from instance scan
This commit is contained in:
parent
f4c3fd97c1
commit
5773434a13
1 changed files with 11 additions and 11 deletions
|
@ -42,18 +42,18 @@ trait AdminInstanceController
|
||||||
|
|
||||||
public function instanceScan(Request $request)
|
public function instanceScan(Request $request)
|
||||||
{
|
{
|
||||||
DB::transaction(function() {
|
Profile::whereNotNull('domain')
|
||||||
Profile::select('domain')->whereNotNull('domain')
|
->latest()
|
||||||
->groupBy('id')
|
->groupBy('domain')
|
||||||
->groupBy('domain')
|
->where('created_at', '>', now()->subMonths(2))
|
||||||
->chunk(50, function($domains) {
|
->chunk(100, function($domains) {
|
||||||
foreach($domains as $domain) {
|
foreach($domains as $domain) {
|
||||||
Instance::firstOrCreate([
|
Instance::firstOrCreate([
|
||||||
'domain' => $domain->domain
|
'domain' => $domain->domain
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue