Fix job dispatching
This commit is contained in:
parent
e482c0df9e
commit
7f9a73360c
8 changed files with 18 additions and 39 deletions
|
@ -1,21 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Jobs;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
|
||||
abstract class Job
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Queueable Jobs
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This job base class provides a central location to place any logic that
|
||||
| is shared across all of your jobs. The trait included with the class
|
||||
| provides access to the "onQueue" and "delay" queue helper methods.
|
||||
|
|
||||
*/
|
||||
|
||||
use Queueable;
|
||||
}
|
|
@ -6,17 +6,17 @@ use Mf2;
|
|||
use App\Note;
|
||||
use App\WebMention;
|
||||
use GuzzleHttp\Client;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Jonnybarnes\WebmentionsParser\Parser;
|
||||
use GuzzleHttp\Exception\RequestException;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use App\Exceptions\RemoteContentNotFoundException;
|
||||
|
||||
class ProcessWebMention extends Job implements ShouldQueue
|
||||
class ProcessWebMention implements ShouldQueue
|
||||
{
|
||||
use InteractsWithQueue, SerializesModels, DispatchesJobs;
|
||||
use InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
protected $note;
|
||||
protected $source;
|
||||
|
@ -60,7 +60,7 @@ class ProcessWebMention extends Job implements ShouldQueue
|
|||
return;
|
||||
}
|
||||
//webmenion is still a reply, so update content
|
||||
$this->dispatch(new SaveProfileImage($microformats));
|
||||
dispatch(new SaveProfileImage($microformats));
|
||||
$webmention->mf2 = json_encode($microformats);
|
||||
$webmention->save();
|
||||
|
||||
|
@ -87,7 +87,7 @@ class ProcessWebMention extends Job implements ShouldQueue
|
|||
//no wemention in db so create new one
|
||||
$webmention = new WebMention();
|
||||
$type = $parser->getMentionType($microformats); //throw error here?
|
||||
$this->dispatch(new SaveProfileImage($microformats));
|
||||
dispatch(new SaveProfileImage($microformats));
|
||||
$webmention->source = $this->source;
|
||||
$webmention->target = $this->note->longurl;
|
||||
$webmention->commentable_id = $this->note->id;
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace App\Jobs;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use GuzzleHttp\Exception\RequestException;
|
||||
|
@ -9,9 +10,9 @@ use Illuminate\Contracts\Queue\ShouldQueue;
|
|||
use Jonnybarnes\WebmentionsParser\Authorship;
|
||||
use Jonnybarnes\WebmentionsParser\Exceptions\AuthorshipParserException;
|
||||
|
||||
class SaveProfileImage extends Job implements ShouldQueue
|
||||
class SaveProfileImage implements ShouldQueue
|
||||
{
|
||||
use InteractsWithQueue, SerializesModels;
|
||||
use InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
protected $microformats;
|
||||
|
||||
|
|
|
@ -4,13 +4,14 @@ namespace App\Jobs;
|
|||
|
||||
use App\Note;
|
||||
use GuzzleHttp\Client;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
|
||||
class SendWebMentions extends Job implements ShouldQueue
|
||||
class SendWebMentions implements ShouldQueue
|
||||
{
|
||||
use InteractsWithQueue, SerializesModels;
|
||||
use InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
protected $note;
|
||||
|
||||
|
|
|
@ -5,15 +5,16 @@ namespace App\Jobs;
|
|||
use Twitter;
|
||||
use App\Note;
|
||||
use App\Contact;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Jonnybarnes\IndieWeb\Numbers;
|
||||
use Jonnybarnes\IndieWeb\NotePrep;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
|
||||
class SyndicateToTwitter extends Job implements ShouldQueue
|
||||
class SyndicateToTwitter implements ShouldQueue
|
||||
{
|
||||
use InteractsWithQueue, SerializesModels;
|
||||
use InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
protected $note;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue