|
|
@@ -108,7 +108,7 @@ def news_worker(source, kw, d, q):
|
|
|
|
|
|
# TODO influx start
|
|
|
|
|
|
-post_data('start', {}, 1)
|
|
|
+post_data('event', {'type': 'start'}, 1)
|
|
|
start = time()
|
|
|
sources = db().sources()
|
|
|
db().purge_error()
|
|
|
@@ -117,8 +117,8 @@ ret = pool.map(parseSource, sources)
|
|
|
new = sum([r[3] for r in ret])
|
|
|
tot = sum([r[1] for r in ret])
|
|
|
|
|
|
-post_data('new', {}, new)
|
|
|
-post_data('total', {}, tot)
|
|
|
+post_data('value', {'type': 'new'}, new)
|
|
|
+post_data('value', {'type': 'total'}, tot)
|
|
|
# TODO influx source new
|
|
|
# TODO influx source total
|
|
|
# n = sum(ret)
|
|
|
@@ -129,4 +129,4 @@ print("[%s] %d/%d new articles, total time %d sec" %
|
|
|
(strftime("%H:%M:%S"), new, tot, time()-start))
|
|
|
print("#" * 75)
|
|
|
# TODO influx end
|
|
|
-post_data('start', {}, 0)
|
|
|
+post_data('even', {'type': 'end'}, 0)
|