Skip to content

Commit d47035f

Browse files
Merge pull request #10 from stackkit/development
4.0.0
2 parents 492fba6 + c259aa2 commit d47035f

7 files changed

+1
-208
lines changed

src/LaravelDatabaseEmailsServiceProvider.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ public function register()
3333
{
3434
$this->commands([
3535
SendEmailsCommand::class,
36-
RetryFailedEmailsCommand::class,
37-
ResendEmailsCommand::class,
3836
]);
3937
}
4038
}

src/ResendEmailsCommand.php

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/RetryFailedEmailsCommand.php

Lines changed: 0 additions & 79 deletions
This file was deleted.

src/SendEmailsCommand.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class SendEmailsCommand extends Command
1313
*
1414
* @var string
1515
*/
16-
protected $signature = 'email:send {--timeout=300}';
16+
protected $signature = 'email:send';
1717

1818
/**
1919
* The console command description.
@@ -48,8 +48,6 @@ public function __construct(Store $store)
4848
*/
4949
public function handle()
5050
{
51-
set_time_limit($this->option('timeout'));
52-
5351
$emails = $this->store->getQueue();
5452

5553
if ($emails->isEmpty()) {
@@ -73,8 +71,6 @@ public function handle()
7371
$progress->finish();
7472

7573
$this->result($emails);
76-
77-
set_time_limit(0);
7874
}
7975

8076
/**

src/Store.php

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,4 @@ public function getQueue()
2929
->limit(Config::cronjobEmailLimit())
3030
->get();
3131
}
32-
33-
/**
34-
* Get all e-mails that failed to be sent.
35-
*
36-
* @param int $id
37-
* @return Collection|Email[]
38-
*/
39-
public function getFailed($id = null)
40-
{
41-
$query = new Email;
42-
43-
return $query
44-
->when($id, function ($query) use ($id) {
45-
$query->where('id', '=', $id);
46-
})
47-
->where('failed', '=', 1)
48-
->where('attempts', '>=', Config::maxAttemptCount())
49-
->whereNull('sent_at')
50-
->whereNull('deleted_at')
51-
->get();
52-
}
5332
}

tests/RetryFailedEmailsCommandTest.php

Lines changed: 0 additions & 67 deletions
This file was deleted.

tests/SendEmailsCommandTest.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -122,18 +122,4 @@ public function the_failed_status_and_error_is_cleared_if_a_previously_failed_em
122122
$this->assertFalse($email->fresh()->hasFailed());
123123
$this->assertEmpty($email->fresh()->getError());
124124
}
125-
126-
/** @test */
127-
public function the_command_will_be_stopped_after_the_timeout()
128-
{
129-
$this->assertEquals(0, ini_get('max_execution_time'));
130-
131-
$this->artisan('email:send');
132-
133-
$this->assertEquals(300, ini_get('max_execution_time'));
134-
135-
$this->artisan('email:send', ['--timeout' => 60]);
136-
137-
$this->assertEquals(60, ini_get('max_execution_time'));
138-
}
139125
}

0 commit comments

Comments
 (0)