1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-25 01:05:36 +00:00

Update AdminInstanceController, remove db transaction from instance scan

This commit is contained in:
Daniel Supernault 2019-10-14 21:31:57 -06:00
parent f4c3fd97c1
commit 5773434a13
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -42,18 +42,18 @@ trait AdminInstanceController
public function instanceScan(Request $request)
{
DB::transaction(function() {
Profile::select('domain')->whereNotNull('domain')
->groupBy('id')
Profile::whereNotNull('domain')
->latest()
->groupBy('domain')
->chunk(50, function($domains) {
->where('created_at', '>', now()->subMonths(2))
->chunk(100, function($domains) {
foreach($domains as $domain) {
Instance::firstOrCreate([
'domain' => $domain->domain
]);
}
});
});
return redirect()->back();
}