This commit is contained in:
2025-10-13 08:30:42 +04:00
parent cf304e004e
commit b154a91867
31 changed files with 242 additions and 242 deletions

View File

@@ -36,6 +36,7 @@ pub fn get(args ArgsGet) !&IPApi {
if r.hexists('context:ipapi', args.name)! {
data := r.hget('context:ipapi', args.name)!
if data.len == 0 {
print_backtrace()
return error('IPApi with name: ipapi does not exist, prob bug.')
}
mut obj := json.decode(IPApi, data)!
@@ -44,12 +45,14 @@ pub fn get(args ArgsGet) !&IPApi {
if args.create {
new(args)!
} else {
print_backtrace()
return error("IPApi with name 'ipapi' does not exist")
}
}
return get(name: args.name)! // no longer from db nor create
}
return ipapi_global[args.name] or {
print_backtrace()
return error('could not get config for ipapi with name:ipapi')
}
}
@@ -122,10 +125,11 @@ pub fn play(mut plbook PlayBook) ! {
}
mut install_actions := plbook.find(filter: 'ipapi.configure')!
if install_actions.len > 0 {
for install_action in install_actions {
for mut install_action in install_actions {
heroscript := install_action.heroscript()
mut obj2 := heroscript_loads(heroscript)!
set(obj2)!
install_action.done = true
}
}
}