mirror of https://github.com/CIRCL/AIL-framework
chg: update Overview
parent
d9b776d58a
commit
108fdb868e
10
OVERVIEW.md
10
OVERVIEW.md
|
@ -46,6 +46,16 @@ ARDB_DB
|
|||
|
||||
* DB 3 - Trending
|
||||
* DB 4 - Sentiment
|
||||
----------------------------------------- SENTIMENT ------------------------------------
|
||||
|
||||
SET - 'Provider_set' Provider
|
||||
|
||||
KEY - 'UniqID' INT
|
||||
|
||||
SET - provider_timestamp UniqID
|
||||
|
||||
SET - UniqID avg_score
|
||||
|
||||
* DB 5 - TermCred
|
||||
* DB 6 - Tags
|
||||
* DB 7 - Metadata
|
||||
|
|
|
@ -45,6 +45,13 @@ cfg = configparser.ConfigParser()
|
|||
cfg.read(configfile)
|
||||
|
||||
sentiment_lexicon_file = cfg.get("Directories", "sentiment_lexicon_file")
|
||||
time_clean_sentiment_db = 60*60
|
||||
|
||||
def clean_db()
|
||||
sevenDays = oneHour*24*7
|
||||
dateStart = datetime.datetime.now()
|
||||
dateStart = dateStart.replace(minute=0, second=0, microsecond=0)
|
||||
dateStart_timestamp = calendar.timegm(dateStart.timetuple())
|
||||
|
||||
def Analyse(message, server):
|
||||
path = message
|
||||
|
@ -157,12 +164,19 @@ if __name__ == '__main__':
|
|||
db=p.config.get("ARDB_Sentiment", "db"),
|
||||
decode_responses=True)
|
||||
|
||||
time1 = time.time()
|
||||
|
||||
while True:
|
||||
message = p.get_from_set()
|
||||
if message is None:
|
||||
publisher.debug("{} queue is empty, waiting".format(config_section))
|
||||
time.sleep(1)
|
||||
continue
|
||||
if int(time.time() - time1) > time_clean_sentiment_db:
|
||||
clean_db()
|
||||
time1 = time.time()
|
||||
continue
|
||||
else:
|
||||
publisher.debug("{} queue is empty, waiting".format(config_section))
|
||||
time.sleep(1)
|
||||
continue
|
||||
signal.alarm(60)
|
||||
try:
|
||||
Analyse(message, server)
|
||||
|
|
Loading…
Reference in New Issue