[gen_confs/generate] --reconnect programme les reconnexions seulement pour les prochaines 24h
This commit is contained in:
parent
7026643353
commit
17199ba900
1 changed files with 6 additions and 4 deletions
|
@ -381,15 +381,17 @@ if __name__ == '__main__':
|
|||
print 'Recherche des personnes en fin de sanction...'
|
||||
c = db.search('blacklist=*')
|
||||
services = []
|
||||
nom = time()
|
||||
hier = time() - 24*3600
|
||||
demain = time() + 24*3600
|
||||
for a_reco in c['adherent'] + c['machine'] + c['club']:
|
||||
for bl in a_reco.blacklist():
|
||||
fin, sanction = bl.split('$')[1:3]
|
||||
if fin > hier and sanction not in services:
|
||||
services.append(sanction)
|
||||
for s in services:
|
||||
if fin != '-' and fin <= demain and fin >= now and (sanction, fin) not in services:
|
||||
services.append((sanction, fin))
|
||||
for s,f in services:
|
||||
print "Ajout de blacklist_%s pour reconfiguration" % s
|
||||
db.services_to_restart('blacklist_%s' % s)
|
||||
db.services_to_restart('blacklist_%s' % s, start=f)
|
||||
sys.exit(0)
|
||||
|
||||
elif opt == '--add':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue