2020-12-11 20:02:07 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
# -*-coding:UTF-8 -*
|
|
|
|
|
|
|
|
import os
|
|
|
|
import re
|
|
|
|
import sys
|
|
|
|
import time
|
|
|
|
import redis
|
|
|
|
import datetime
|
|
|
|
|
|
|
|
sys.path.append(os.path.join(os.environ['AIL_BIN'], 'lib/'))
|
|
|
|
import ConfigLoader
|
|
|
|
|
2021-04-14 14:27:39 +00:00
|
|
|
sys.path.append(os.path.join(os.environ['AIL_HOME'], 'update', 'bin'))
|
2022-07-08 07:47:47 +00:00
|
|
|
from old_ail_updater import AIL_Updater
|
2020-12-11 20:02:07 +00:00
|
|
|
|
2021-04-14 14:27:39 +00:00
|
|
|
class Updater(AIL_Updater):
|
|
|
|
"""default Updater."""
|
2020-12-11 20:02:07 +00:00
|
|
|
|
2021-04-14 14:27:39 +00:00
|
|
|
def __init__(self, version):
|
|
|
|
super(Updater, self).__init__(version)
|
|
|
|
self.r_serv_onion = self.config.get_redis_conn("ARDB_Onion")
|
2020-12-11 20:02:07 +00:00
|
|
|
|
2021-04-14 14:27:39 +00:00
|
|
|
def update(self):
|
|
|
|
"""
|
|
|
|
Update Domain Languages
|
|
|
|
"""
|
|
|
|
self.r_serv_onion.sunionstore('domain_update_v3.4', 'full_onion_up', 'full_regular_up')
|
|
|
|
self.r_serv.set('update:nb_elem_to_convert', self.r_serv_onion.scard('domain_update_v3.4'))
|
|
|
|
self.r_serv.set('update:nb_elem_converted',0)
|
2020-12-11 20:02:07 +00:00
|
|
|
|
2021-04-14 14:27:39 +00:00
|
|
|
# Add background update
|
|
|
|
self.r_serv.sadd('ail:to_update', self.version)
|
2020-12-11 20:43:49 +00:00
|
|
|
|
2021-04-14 14:27:39 +00:00
|
|
|
if __name__ == '__main__':
|
2020-12-11 20:02:07 +00:00
|
|
|
|
2021-04-14 14:27:39 +00:00
|
|
|
updater = Updater('v3.4')
|
|
|
|
updater.run_update()
|