Skip to content

Commit f2f3c51

Browse files
authored
Cache Task frequencies (#302)
* Cache also the tasks frequencies, so they won't be queried in every schedule registration * Fixed StyleCI errors
1 parent 93861f7 commit f2f3c51

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Repositories/EloquentTaskRepository.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function find($id)
5454
}
5555

5656
return Cache::rememberForever('totem.task.'.$id, function () use ($id) {
57-
return Task::find($id);
57+
return Task::query()->with('frequencies')->find($id);
5858
});
5959
}
6060

@@ -66,7 +66,7 @@ public function find($id)
6666
public function findAll()
6767
{
6868
return Cache::rememberForever('totem.tasks.all', function () {
69-
return Task::all();
69+
return Task::query()->with('frequencies')->get();
7070
});
7171
}
7272

0 commit comments

Comments
 (0)