Implement restricted sources
This commit is contained in:
parent
cb11ce9b12
commit
38d00f2c21
9
db.py
9
db.py
|
@ -32,6 +32,12 @@ TYPES_MAIN = [
|
||||||
"topic",
|
"topic",
|
||||||
"update",
|
"update",
|
||||||
]
|
]
|
||||||
|
MAIN_SRC_MAP = {
|
||||||
|
"dis": "main",
|
||||||
|
"irc": "restricted",
|
||||||
|
"4ch": "main",
|
||||||
|
}
|
||||||
|
|
||||||
TYPES_META = ["who"]
|
TYPES_META = ["who"]
|
||||||
TYPES_INT = ["conn", "highlight", "znc", "query", "self"]
|
TYPES_INT = ["conn", "highlight", "znc", "query", "self"]
|
||||||
KEYPREFIX = "queue."
|
KEYPREFIX = "queue."
|
||||||
|
@ -44,7 +50,8 @@ async def store_kafka_batch(data):
|
||||||
batch = producer.create_batch()
|
batch = producer.create_batch()
|
||||||
for msg in data:
|
for msg in data:
|
||||||
if msg["type"] in TYPES_MAIN:
|
if msg["type"] in TYPES_MAIN:
|
||||||
index = "main"
|
#index = "main"
|
||||||
|
index = MAIN_SRC_MAP[msg["src"]]
|
||||||
# schema = mc_s.schema_main
|
# schema = mc_s.schema_main
|
||||||
elif msg["type"] in TYPES_META:
|
elif msg["type"] in TYPES_META:
|
||||||
index = "meta"
|
index = "meta"
|
||||||
|
|
Loading…
Reference in New Issue