I'm trying to use google.appengine.ext.deferred to run a Task. I am passing a method to the defer() method, and that method runs successfully, but upon returning, a ValueError is thrown:
File ".../admin.py", line 73, in post
result = deferred.defer(meeple_tasks.buildGames())
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/deferred/deferred.py", line 198, in _curry_callable
raise ValueError("obj must be callable")
ValueError: obj must be callable
Here is where I call defer:
result = deferred.defer(meeple_tasks.buildGames())
buildGames() will return True when completed.
You should use:
result = deferred.defer(meeple_tasks.buildGames)
If you use buildGames(), that invokes the function right then and there, passing the return value to defer(). By removing the parenthesis, you pass the function itself to defer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With