mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-23 05:23:17 +00:00
commit
65a500a97a
3 changed files with 62 additions and 0 deletions
|
@ -130,6 +130,7 @@
|
|||
- Updated AccountInterstitialController, add autospam type. ([c67f0c57](https://github.com/pixelfed/pixelfed/commit/c67f0c57))
|
||||
- Updated Profile model, improve counter caching. ([4a14e970](https://github.com/pixelfed/pixelfed/commit/4a14e970))
|
||||
- Updated ComposeModal, fix filter bug on safari. ([8e3e7586](https://github.com/pixelfed/pixelfed/commit/8e3e7586))
|
||||
- Updated StatusStatelessController, remove unused attributes. ([d0d46807](https://github.com/pixelfed/pixelfed/commit/d0d46807))
|
||||
|
||||
## [v0.10.9 (2020-04-17)](https://github.com/pixelfed/pixelfed/compare/v0.10.8...v0.10.9)
|
||||
### Added
|
||||
|
|
60
app/Console/Commands/FixSoftDeletedProfile.php
Normal file
60
app/Console/Commands/FixSoftDeletedProfile.php
Normal file
|
@ -0,0 +1,60 @@
|
|||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use App\Profile;
|
||||
use App\User;
|
||||
|
||||
class FixSoftDeletedProfile extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'fix:sdprofile';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Command description';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$profiles = Profile::whereNull('domain')
|
||||
->withTrashed()
|
||||
->where('deleted_at', '>', now()->subDays(14))
|
||||
->whereNull('status')
|
||||
->pluck('username');
|
||||
|
||||
if($profiles->count() == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
foreach($profiles as $p) {
|
||||
if(User::whereUsername($p)->first()->status == null) {
|
||||
$pro = Profile::withTrashed()->whereUsername($p)->firstOrFail();
|
||||
$pro->deleted_at = null;
|
||||
$pro->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -31,6 +31,7 @@ class Kernel extends ConsoleKernel
|
|||
->hourly();
|
||||
$schedule->command('horizon:snapshot')->everyFiveMinutes();
|
||||
$schedule->command('story:gc')->everyFiveMinutes();
|
||||
$schedule->command('fix:sdprofile')->everyFiveMinutes();
|
||||
$schedule->command('gc:failedjobs')->dailyAt(3);
|
||||
$schedule->command('gc:passwordreset')->dailyAt('09:41');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue