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:
If you use
buildGames(), that invokes the function right then and there, passing the return value todefer(). By removing the parenthesis, you pass the function itself to defer.