Skip to content

Commit 18e5002

Browse files
Merge pull request #10 from odinti/master
Remove caching
2 parents d7e7682 + 42e0170 commit 18e5002

File tree

1 file changed

+9
-20
lines changed

1 file changed

+9
-20
lines changed

src/Process/MJML.php

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,15 @@ public function buildCmdLineFromConfig()
3737

3838
public function renderHTML()
3939
{
40-
if ($this->isExpired()) {
41-
$html = $this->view->render();
42-
File::put($this->path, $html);
43-
44-
$this->process = new Process($this->buildCmdLineFromConfig());
45-
$this->process->run();
46-
// executes after the command finishes
47-
if (! $this->process->isSuccessful()) {
48-
throw new ProcessFailedException($this->process);
49-
}
40+
$html = $this->view->render();
41+
File::put($this->path, $html);
42+
43+
$this->process = new Process($this->buildCmdLineFromConfig());
44+
$this->process->run();
45+
// executes after the command finishes
46+
File::delete($this->path);
47+
if (! $this->process->isSuccessful()) {
48+
throw new ProcessFailedException($this->process);
5049
}
5150

5251
return new HtmlString(File::get($this->compiledPath));
@@ -61,14 +60,4 @@ public function detectBinaryPath()
6160
{
6261
return base_path('node_modules/.bin/mjml');
6362
}
64-
65-
public function isExpired()
66-
{
67-
if (! File::exists($this->compiledPath)) {
68-
return true;
69-
}
70-
71-
return File::lastModified($this->view->getPath()) >=
72-
File::lastModified($this->compiledPath);
73-
}
7463
}

0 commit comments

Comments
 (0)