mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-22 04:58:01 +01:00
Prepared asynchronous jobs to run in daemon mode.
This commit is contained in:
parent
23ae7ffa72
commit
e35752d11a
4 changed files with 10 additions and 0 deletions
|
@ -21,6 +21,7 @@
|
|||
namespace Poniverse\Ponyfm\Jobs;
|
||||
|
||||
use Auth;
|
||||
use DB;
|
||||
use Poniverse\Ponyfm\Models\Genre;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Contracts\Bus\SelfHandling;
|
||||
|
@ -60,6 +61,8 @@ class DeleteGenre extends Job implements SelfHandling, ShouldQueue
|
|||
*/
|
||||
public function handle()
|
||||
{
|
||||
DB::reconnect();
|
||||
|
||||
// The user who kicked off this job is used when generating revision log entries.
|
||||
Auth::login($this->executingUser);
|
||||
|
||||
|
|
|
@ -85,6 +85,8 @@ class EncodeTrackFile extends Job implements SelfHandling, ShouldQueue
|
|||
*/
|
||||
public function handle()
|
||||
{
|
||||
DB::reconnect();
|
||||
|
||||
// Sanity-check: was this file just generated, or is it already being processed?
|
||||
if ($this->trackFile->status === TrackFile::STATUS_PROCESSING) {
|
||||
Log::warning('Track file #'.$this->trackFile->id.' (track #'.$this->trackFile->track_id.') is already being processed!');
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
namespace Poniverse\Ponyfm\Jobs;
|
||||
|
||||
use DB;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
|
@ -51,6 +52,7 @@ class UpdateSearchIndexForEntity extends Job implements SelfHandling, ShouldQueu
|
|||
*/
|
||||
public function handle()
|
||||
{
|
||||
DB::reconnect();
|
||||
$this->entity->updateElasticsearchEntrySynchronously();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ namespace Poniverse\Ponyfm\Jobs;
|
|||
|
||||
use Auth;
|
||||
use Cache;
|
||||
use DB;
|
||||
use Log;
|
||||
use Poniverse\Ponyfm\Models\Genre;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
|
@ -66,6 +67,8 @@ class UpdateTagsForRenamedGenre extends Job implements SelfHandling, ShouldQueue
|
|||
*/
|
||||
public function handle()
|
||||
{
|
||||
DB::reconnect();
|
||||
|
||||
// The user who kicked off this job is used when generating revision log entries.
|
||||
Auth::login($this->executingUser);
|
||||
|
||||
|
|
Loading…
Reference in a new issue