Skip to content

Commit

Permalink
refactor: automatically open when a value is stored in the cache
Browse files Browse the repository at this point in the history
  • Loading branch information
cbochs committed Apr 28, 2024
1 parent d97dbb6 commit c23cbf6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions lua/grapple/app.lua
Original file line number Diff line number Diff line change
Expand Up @@ -477,9 +477,6 @@ function App:resolve_scope(opts)
return nil, err
end

if not self.scope_manager.cache:exists(scope.id) then
self.scope_manager.cache:open(scope.id, {})
end
self.scope_manager.cache:store(scope.id, scope)

return scope, nil
Expand Down
2 changes: 1 addition & 1 deletion lua/grapple/cache.lua
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ end
---@param value any
function Cache:store(id, value)
if not self:exists(id) then
return
self:open(id, {})
end

local cache_value = self.cache[id]
Expand Down

0 comments on commit c23cbf6

Please sign in to comment.