Skip to content

Commit

Permalink
Merge pull request #67 from solareon/fix-sql
Browse files Browse the repository at this point in the history
fix(server/main): use await for sql to prevent errors
  • Loading branch information
FjamZoo authored Aug 27, 2024
2 parents 024cfd3 + 6bd4273 commit 7d70091
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ CreateThread(function()
error(locale("ui_not_built"))
return StopResource("Renewed-Banking")
end
MySQL.query('SELECT * FROM bank_accounts_new', {}, function(accounts)
local accounts = MySQL.query.await('SELECT * FROM bank_accounts_new', {})
if accounts then
for _,v in pairs (accounts) do
local job = v.id
v.auth = json.decode(v.auth)
Expand All @@ -27,7 +28,7 @@ CreateThread(function()
end
end
end
end)
end
local jobs, gangs = GetFrameworkGroups()
local function addCachedAccount(group)
cachedAccounts[group] = {
Expand Down

0 comments on commit 7d70091

Please sign in to comment.