Skip to content

Commit

Permalink
fix: high CPU usage with invalid config (fixes #49) (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
danields761 committed Sep 30, 2023
1 parent 4ccc1c6 commit ee41d71
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lua/edgy/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,9 @@ function M.with_retry(fn, max_retries)
local retries = 0
local function try()
local ok, ret = pcall(fn)
if ok then
retries = 0
else
if retries >= max_retries or require("edgy.config").debug then
if not ok then
retries = retries + 1
if retries >= max_retries then
M.error(ret)
end
if retries < max_retries then
Expand Down

0 comments on commit ee41d71

Please sign in to comment.