mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-16 10:40:12 +00:00
feat(stats): don't require a stats database url
This commit is contained in:
parent
2fea773d7e
commit
d1d0faaa7e
2 changed files with 9 additions and 1 deletions
|
|
@ -70,6 +70,10 @@ func run_data_stats_query() map[string]interface{} {
|
|||
}
|
||||
|
||||
func do_stats_insert(table string, value int) {
|
||||
if stats_db == nil {
|
||||
return
|
||||
}
|
||||
|
||||
sql := fmt.Sprintf("insert into %s values (now(), $1)", table)
|
||||
log.Println("stats db query:", sql, "value:", value)
|
||||
_, err := stats_db.Exec(context.Background(), sql, value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue