mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
fix(scheduled_tasks): maybe actually make it work
This commit is contained in:
parent
97d2f15501
commit
823db4cd24
2 changed files with 5 additions and 5 deletions
|
|
@ -69,7 +69,7 @@ func run_data_stats_query() map[string]interface{} {
|
|||
return s
|
||||
}
|
||||
|
||||
func do_stats_insert(table string, value int) {
|
||||
func do_stats_insert(table string, value int64) {
|
||||
if stats_db == nil {
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ func task_main() {
|
|||
log.Println("running per-minute scheduled tasks")
|
||||
|
||||
update_db_meta()
|
||||
update_stats()
|
||||
update_bot_status()
|
||||
update_stats()
|
||||
}
|
||||
|
||||
var table_stat_keys = []string{"system", "member", "group", "switch", "message"}
|
||||
|
|
@ -66,13 +66,13 @@ func get_discord_counts() (int, int) {
|
|||
func update_stats() {
|
||||
guild_count, channel_count := get_discord_counts()
|
||||
|
||||
do_stats_insert("guilds", guild_count)
|
||||
do_stats_insert("channels", channel_count)
|
||||
do_stats_insert("guilds", int64(guild_count))
|
||||
do_stats_insert("channels", int64(channel_count))
|
||||
|
||||
data_stats := run_data_stats_query()
|
||||
for _, key := range table_stat_keys {
|
||||
val := data_stats[key+"_count"].(int64)
|
||||
do_stats_insert(plural(key), int(val))
|
||||
do_stats_insert(plural(key), val)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue