Skip to content

Commit 631b84e

Browse files
committed
action class configured to work based on artisan cmd
1 parent ff51b44 commit 631b84e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/Action.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
class Action
1010
{
11-
public function emit()
11+
public function emit($poll = 10)
1212
{
1313
if(! $receiver = config('scheduledaction.receiver')) return;
1414

@@ -17,7 +17,7 @@ public function emit()
1717
$callableReceiver = new $receiver;
1818
call_user_func(
1919
$callableReceiver,
20-
$this->needsToRunToday( config('scheduledaction.actions_per_poll') )
20+
$this->needsToRunToday( $poll )
2121
);
2222
}
2323

src/ActionableServiceProvider.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Devsrv\ScheduledAction;
44

55
use Illuminate\Support\ServiceProvider;
6+
use Devsrv\ScheduledAction\Console\PollScheduledAction;
67

78
class ActionableServiceProvider extends ServiceProvider
89
{
@@ -24,6 +25,10 @@ public function boot()
2425
$this->publishes([
2526
__DIR__.'/../config/config.php' => config_path('scheduledaction.php'),
2627
], 'config');
28+
29+
$this->commands([
30+
PollScheduledAction::class,
31+
]);
2732
}
2833
}
2934

0 commit comments

Comments
 (0)