Re-enable posting

This commit is contained in:
idanoo 2023-02-13 08:48:38 +13:00
parent c2b054158d
commit f86c26b84f
Signed by: idanoo
GPG key ID: 387387CDBC02F132
2 changed files with 10 additions and 11 deletions

View file

@ -3,6 +3,7 @@ package gomastodonstats
import (
"log"
"sort"
"time"
)
func Run() {
@ -22,16 +23,16 @@ func Run() {
return updatedMetrics[i].MetricValue > updatedMetrics[j].MetricValue
})
// sendToMatrix(updatedMetrics)
sendToMatrix(updatedMetrics)
// Only post weekly here
// localTime, err := time.LoadLocation(TIMEZONE)
// if err != nil {
// log.Fatal(err)
// }
// weekday := time.Now().Local().In(localTime).Weekday()
// if weekday == time.Monday {
// postToMastodon(updatedMetrics)
// }
localTime, err := time.LoadLocation(TIMEZONE)
if err != nil {
log.Fatal(err)
}
weekday := time.Now().Local().In(localTime).Weekday()
if weekday == time.Monday {
postToMastodon(updatedMetrics)
}
}
}

View file

@ -173,8 +173,6 @@ func getLastWeekMetric(serviceName string) int {
monday,
)
log.Println(val)
if err != nil {
log.Println(err)
return 0