always add alias label
All checks were successful
Gitea/osrsscrape/pipeline/head This commit looks good
All checks were successful
Gitea/osrsscrape/pipeline/head This commit looks good
This commit is contained in:
parent
e3c0338ce2
commit
ca34141a83
@ -1,3 +1,4 @@
|
||||
import os
|
||||
import sys
|
||||
import json
|
||||
import logging
|
||||
@ -16,7 +17,8 @@ def get_influx(influx_urls):
|
||||
|
||||
db_name = url.path[1:]
|
||||
|
||||
influx = InfluxDBClient(url.hostname, url.port, url.username, url.password)
|
||||
influx = InfluxDBClient(url.hostname, url.port, url.username, url.password,
|
||||
timeout=int(os.environ.get("RSSCRAPE_CONNECT_TIMEOUT", 5)))
|
||||
influx.create_database(db_name)
|
||||
influx.switch_database(db_name)
|
||||
|
||||
@ -53,12 +55,14 @@ def main(player_name, alias, influx_url, timeout, dry_run):
|
||||
for stat in stats:
|
||||
fields[stat.skill] = getattr(stat, measurement)
|
||||
|
||||
blob = {"measurement": measurement,
|
||||
"tags": {"username": player_name},
|
||||
"fields": fields}
|
||||
|
||||
if alias:
|
||||
blob["tags"]["alias"] = alias
|
||||
blob = {
|
||||
"measurement": measurement,
|
||||
"fields": fields,
|
||||
"tags": {
|
||||
"username": player_name,
|
||||
"alias": alias or player_name,
|
||||
},
|
||||
}
|
||||
|
||||
body.append(blob)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user