Added failsafe for extra parameters
This commit is contained in:
@@ -516,7 +516,27 @@ class AppBase:
|
|||||||
for subparams in param_multiplier:
|
for subparams in param_multiplier:
|
||||||
print(f"SUBPARAMS IN MULTI: {subparams}")
|
print(f"SUBPARAMS IN MULTI: {subparams}")
|
||||||
try:
|
try:
|
||||||
tmp = await func(**subparams)
|
#tmp = await func(**subparams)
|
||||||
|
|
||||||
|
while True:
|
||||||
|
try:
|
||||||
|
tmp = await func(**subparams)
|
||||||
|
break
|
||||||
|
except TypeError as e:
|
||||||
|
errorstring = "%s" % e
|
||||||
|
if "got an unexpected keyword argument" in errorstring:
|
||||||
|
fieldsplit = errorstring.split("'")
|
||||||
|
if len(fieldsplit) > 1:
|
||||||
|
field = fieldsplit[1]
|
||||||
|
|
||||||
|
try:
|
||||||
|
del subparams[field]
|
||||||
|
print("Removed field invalid field %s" % field)
|
||||||
|
except KeyError:
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
raise e
|
||||||
|
|
||||||
except:
|
except:
|
||||||
e = ""
|
e = ""
|
||||||
try:
|
try:
|
||||||
@@ -2139,7 +2159,28 @@ class AppBase:
|
|||||||
return
|
return
|
||||||
|
|
||||||
print("[INFO] Running normal execution\n")
|
print("[INFO] Running normal execution\n")
|
||||||
newres = await func(**params)
|
|
||||||
|
#newres = await func(**params)
|
||||||
|
while True:
|
||||||
|
try:
|
||||||
|
newres = await func(**params)
|
||||||
|
break
|
||||||
|
except TypeError as e:
|
||||||
|
errorstring = "%s" % e
|
||||||
|
if "got an unexpected keyword argument" in errorstring:
|
||||||
|
fieldsplit = errorstring.split("'")
|
||||||
|
if len(fieldsplit) > 1:
|
||||||
|
field = fieldsplit[1]
|
||||||
|
|
||||||
|
try:
|
||||||
|
del params[field]
|
||||||
|
print("Removed field invalid field %s" % field)
|
||||||
|
except KeyError:
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
raise e
|
||||||
|
#break
|
||||||
|
|
||||||
print("\n[INFO] Returned from execution!")#, newres)
|
print("\n[INFO] Returned from execution!")#, newres)
|
||||||
if isinstance(newres, tuple):
|
if isinstance(newres, tuple):
|
||||||
print("[INFO] Handling return as tuple")
|
print("[INFO] Handling return as tuple")
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
NAME=shuffle-app_sdk
|
NAME=shuffle-app_sdk
|
||||||
VERSION=0.8.80
|
VERSION=0.8.81
|
||||||
|
|
||||||
docker rmi docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION --force
|
docker rmi docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION --force
|
||||||
docker build . -t frikky/shuffle:app_sdk -t frikky/$NAME:$VERSION -t docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION -t ghcr.io/frikky/$NAME:$VERSION
|
docker build . -t frikky/shuffle:app_sdk -t frikky/$NAME:$VERSION -t docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION -t ghcr.io/frikky/$NAME:$VERSION
|
||||||
|
|||||||
Reference in New Issue
Block a user