mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-03-14 12:23:33 +00:00
feat(#194): refactor cache to be device specific
This commit is contained in:
parent
c194ab5db1
commit
26b5f3ceb1
8 changed files with 278 additions and 110 deletions
|
|
@ -34,8 +34,13 @@ class GenerateScreenJob implements ShouldQueue
|
|||
Device::find($this->deviceId)->update(['current_screen_image' => $newImageUuid]);
|
||||
|
||||
if ($this->pluginId) {
|
||||
// cache current image
|
||||
Plugin::find($this->pluginId)->update(['current_image' => $newImageUuid]);
|
||||
$plugin = Plugin::find($this->pluginId);
|
||||
$update = ['current_image' => $newImageUuid];
|
||||
if ($plugin->plugin_type === 'recipe') {
|
||||
$device = Device::with(['deviceModel', 'deviceModel.palette'])->find($this->deviceId);
|
||||
$update['current_image_metadata'] = ImageGenerationService::buildImageMetadataFromDevice($device);
|
||||
}
|
||||
$plugin->update($update);
|
||||
}
|
||||
|
||||
ImageGenerationService::cleanupFolder();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue