summaryrefslogtreecommitdiffstats
path: root/func
diff options
context:
space:
mode:
authorKrzysztof A. Adamski <krzysztofa@gmail.com>2008-06-29 14:43:20 -0400
committerKrzysztof A. Adamski <krzysztofa@gmail.com>2008-06-29 14:43:20 -0400
commita5929a01854dd53828e10008b68763c3959632ec (patch)
treeb94d800396ff16edb4327c03b3d2809606935c09 /func
parentd774652d1abfe763dcecb208beb36c0136e6f838 (diff)
downloadthird_party-func-a5929a01854dd53828e10008b68763c3959632ec.tar.gz
third_party-func-a5929a01854dd53828e10008b68763c3959632ec.tar.xz
third_party-func-a5929a01854dd53828e10008b68763c3959632ec.zip
Add support for forcing some long running methods to be called in async mode from command line.
Diffstat (limited to 'func')
-rw-r--r--func/overlord/cmd_modules/call.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/func/overlord/cmd_modules/call.py b/func/overlord/cmd_modules/call.py
index 18af3a6..648bcab 100644
--- a/func/overlord/cmd_modules/call.py
+++ b/func/overlord/cmd_modules/call.py
@@ -17,13 +17,19 @@ import optparse
import pprint
import xmlrpclib
import time
+import sys
from func.overlord import client
from func.overlord import base_command
+from func.config import read_config, BaseConfig, ListOption
import func.jobthing as jobthing
DEFAULT_FORKS = 1
+config_file = '/etc/func/async_methods.conf'
+
+class CallConfig(BaseConfig):
+ force_async = ListOption('')
class Call(base_command.BaseCommand):
name = "call"
@@ -126,6 +132,9 @@ class Call(base_command.BaseCommand):
# or some sort of shared datastruct?
# self.getOverlord()
+ call_config = read_config(config_file, CallConfig)
+ if self.method and (self.module+"."+self.method in call_config.force_async):
+ self.options.async=True
self.interactive = False
self.async = self.options.async