mirror of https://git.skyjake.fi/gemini/bubble.git
Updated for GmCapsule v0.5 API changes
Check if background work can be started.
This commit is contained in:
parent
309f0ecfe3
commit
0df59c3ee9
19
50_bubble.py
19
50_bubble.py
|
@ -619,8 +619,8 @@ when the administrator assigns at least one moderator to it.
|
|||
return make_feed_page(session)
|
||||
|
||||
|
||||
def init(capsule):
|
||||
cfg = capsule.config()
|
||||
def init(context):
|
||||
cfg = context.config()
|
||||
try:
|
||||
mod_cfg = cfg.section('bubble')
|
||||
|
||||
|
@ -636,15 +636,16 @@ def init(capsule):
|
|||
port = cfg.section('server').getint('port', 1965)
|
||||
|
||||
for hostname in hostnames:
|
||||
responder = Bubble(capsule, hostname, port, path, mod_cfg)
|
||||
capsule.add(path + '*', responder, hostname, protocol='gemini')
|
||||
capsule.add(path + '*', responder, hostname, protocol='titan')
|
||||
responder = Bubble(context, hostname, port, path, mod_cfg)
|
||||
context.add(path + '*', responder, hostname, protocol='gemini')
|
||||
context.add(path + '*', responder, hostname, protocol='titan')
|
||||
|
||||
emailer = Emailer(capsule, hostnames[0], port, mod_cfg)
|
||||
emailer.start()
|
||||
if context.is_background_work_allowed():
|
||||
emailer = Emailer(context, hostnames[0], port, mod_cfg)
|
||||
emailer.start()
|
||||
|
||||
fetcher = RepoFetcher(capsule, mod_cfg)
|
||||
fetcher.start()
|
||||
fetcher = RepoFetcher(context, mod_cfg)
|
||||
fetcher.start()
|
||||
|
||||
except KeyError:
|
||||
pass
|
||||
|
|
Loading…
Reference in New Issue