From 41c2855da8dad5b6dfb0983fdbbc46fab25fe1df Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Tue, 15 Jan 2008 18:04:57 -0500 Subject: Make the --forks option also use storage that is not homedir based. --- func/overlord/forkbomb.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'func') diff --git a/func/overlord/forkbomb.py b/func/overlord/forkbomb.py index 1ff529d..c30cc9e 100644 --- a/func/overlord/forkbomb.py +++ b/func/overlord/forkbomb.py @@ -22,7 +22,7 @@ import tempfile import fcntl DEFAULT_FORKS = 4 -DEFAULT_CACHE_DIR = "~/.func" +DEFAULT_CACHE_DIR = "/var/lib/func" def __get_storage(dir): """ @@ -31,7 +31,7 @@ def __get_storage(dir): dir = os.path.expanduser(dir) if not os.path.exists(dir): os.makedirs(dir) - return tempfile.mktemp(suffix='', prefix='tmp', dir=dir) + return tempfile.mktemp(suffix='', prefix='asynctmp', dir=dir) def __access_buckets(filename,clear,new_key=None,new_value=None): """ @@ -133,7 +133,7 @@ def batch_run(pool,callback,nforks=DEFAULT_FORKS,cachedir=DEFAULT_CACHE_DIR): if nforks <= 1: # modulus voodoo gets crazy otherwise and bad things happen nforks = 2 - shelf_file = __get_storage("~/.func") + shelf_file = __get_storage(cachedir) __access_buckets(shelf_file,True,None) buckets = __bucketize(pool, nforks) # print "DEBUG: buckets: %s" % buckets -- cgit