summaryrefslogtreecommitdiff
path: root/geneticone/backend/flags.py
diff options
context:
space:
mode:
authornecoro <>2006-10-12 13:34:01 +0000
committernecoro <>2006-10-12 13:34:01 +0000
commit67dbc7e1c8ce5bcaad70623a1cec58009c61840c (patch)
tree82f4ef6766a403604794811dfca12b4805ad9d58 /geneticone/backend/flags.py
parentdf780a240e03a92c8bc854c053b96a4203960634 (diff)
downloadportato-67dbc7e1c8ce5bcaad70623a1cec58009c61840c.tar.gz
portato-67dbc7e1c8ce5bcaad70623a1cec58009c61840c.tar.bz2
portato-67dbc7e1c8ce5bcaad70623a1cec58009c61840c.zip
Fixed bugs
Diffstat (limited to 'geneticone/backend/flags.py')
-rw-r--r--geneticone/backend/flags.py25
1 files changed, 13 insertions, 12 deletions
diff --git a/geneticone/backend/flags.py b/geneticone/backend/flags.py
index 1d2f321..cb26935 100644
--- a/geneticone/backend/flags.py
+++ b/geneticone/backend/flags.py
@@ -301,19 +301,20 @@ def write_use_flags ():
insert(flag,l)
file_cache[file][line-1] = " ".join(l)
+ if flagsToAdd:
# write new lines
- msg = "\n#geneticone update#\n"
- if CONFIG["usePerVersion"]: # add on a per-version-base
- msg += "=%s %s\n" % (cpv, ' '.join(flagsToAdd))
- else: # add on a per-package-base
- list = split_package_name(cpv)
- msg += "%s/%s %s\n" % (list[0], list[1], ' '.join(flagsToAdd))
- if not file in file_cache:
- f = open(file, "a")
- f.write(msg)
- f.close()
- else:
- file_cache[file].append(msg)
+ msg = "\n#geneticone update#\n"
+ if CONFIG["usePerVersion"]: # add on a per-version-base
+ msg += "=%s %s\n" % (cpv, ' '.join(flagsToAdd))
+ else: # add on a per-package-base
+ list = split_package_name(cpv)
+ msg += "%s/%s %s\n" % (list[0], list[1], ' '.join(flagsToAdd))
+ if not file in file_cache:
+ f = open(file, "a")
+ f.write(msg)
+ f.close()
+ else:
+ file_cache[file].append(msg)
# write to disk
for file in file_cache.keys():
>2006-12-10Add license file and copyright noticesLars Hjemli5-0/+372 Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2006-12-10Add caching infrastructureLars Hjemli9-28/+353 This enables internal caching of page output. Page requests are split into four groups: 1) repo listing (front page) 2) repo summary 3) repo pages w/symbolic references in query string 4) repo pages w/constant sha1's in query string Each group has a TTL specified in minutes. When a page is requested, a cached filename is stat(2)'ed and st_mtime is compared to time(2). If TTL has expired (or the file didn't exist), the cached file is regenerated. When generating a cached file, locking is used to avoid parallell processing of the request. If multiple processes tries to aquire the same lock, the ones who fail to get the lock serves the (expired) cached file. If the cached file don't exist, the process instead calls sched_yield(2) before restarting the request processing. Signed-off-by: Lars Hjemli <hjemli@gmail.com>