Skip to content
This repository has been archived by the owner on Jan 31, 2023. It is now read-only.

Commit

Permalink
fix twitter logging
Browse files Browse the repository at this point in the history
  • Loading branch information
JustHumanz committed Mar 11, 2022
1 parent 77a4e02 commit d5b2663
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
11 changes: 0 additions & 11 deletions pkg/database/fanart.go
Original file line number Diff line number Diff line change
Expand Up @@ -501,17 +501,6 @@ func (Member Member) ScrapTwitterFanart(Scraper *twitterscraper.Scraper, Lewd bo
}
}()

log.WithFields(log.Fields{
"Hashtag": func() string {
if Lewd {
return Member.TwitterLewd
}
return Member.TwitterHashtag
}(),
"Vtuber": Member.Name,
"Lewd": Lewd,
}).Info("Start curl twitter")

for tweet := range Scraper.SearchTweets(context.Background(), Query, config.GoSimpConf.LimitConf.TwitterFanart) {
if tweet.Error != nil {
log.Error(tweet.Error)
Expand Down
16 changes: 16 additions & 0 deletions service/fanart/twitter/twitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,14 @@ type checkTwJob struct {
func (i *checkTwJob) Run() {
Cek := func(Member database.Member, w *sync.WaitGroup) {
defer w.Done()

log.WithFields(log.Fields{
"Hashtag": Member.TwitterHashtag,
"Vtuber": Member.Name,
"Agency": Member.Group.GroupName,
"Lewd": false,
}).Info("Start curl twitter")

Fanarts, err := Member.ScrapTwitterFanart(engine.InitTwitterScraper(), false)
if err != nil {
log.WithFields(log.Fields{
Expand All @@ -161,6 +169,14 @@ func (i *checkTwJob) Run() {
}

if *lewd {

log.WithFields(log.Fields{
"Hashtag": Member.TwitterLewd,
"Vtuber": Member.Name,
"Agency": Member.Group.GroupName,
"Lewd": true,
}).Info("Start curl twitter")

Fanarts, err := Member.ScrapTwitterFanart(engine.InitTwitterScraper(), true)
if err != nil {
log.WithFields(log.Fields{
Expand Down

0 comments on commit d5b2663

Please sign in to comment.