Skip to content

Commit

Permalink
Align code
Browse files Browse the repository at this point in the history
  • Loading branch information
petyos committed May 2, 2024
1 parent 01d01b3 commit 7a69889
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions core/logic_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func (e eventsLogic) setupWebToolsTimer() {
}

//wait until it is the correct moment from the day
location, err := time.LoadLocation("America/Chicago")
/*location, err := time.LoadLocation("America/Chicago")
if err != nil {
e.logger.Errorf("Error getting location:%s\n", err.Error())
}
Expand All @@ -198,9 +198,9 @@ func (e eventsLogic) setupWebToolsTimer() {
leftToday := 86400 - nowSecondsInDay
durationInSeconds = leftToday + desiredMoment // the time which left today + desired moment from tomorrow
}
log.Println(durationInSeconds)
//duration := time.Second * time.Duration(3)
duration := time.Second * time.Duration(durationInSeconds)
log.Println(durationInSeconds) */
duration := time.Second * time.Duration(3)
//duration := time.Second * time.Duration(durationInSeconds)
e.logger.Infof("setupWebToolsTimer -> first call after %s", duration)

e.dailyWebToolsTimer = time.NewTimer(duration)
Expand Down Expand Up @@ -247,13 +247,6 @@ func (e eventsLogic) processWebToolsEvents() {
e.logger.Errorf("error on loading web tools events - %s", err)
return
}
var withimage []model.WebToolsEvent
for _, l := range allWebToolsEvents {
if l.LargeImageUploaded != "" {
withimage = append(withimage, l)
}
allWebToolsEvents = withimage
}

webToolsCount := len(allWebToolsEvents)
if webToolsCount == 0 {
Expand All @@ -263,6 +256,14 @@ func (e eventsLogic) processWebToolsEvents() {

e.logger.Infof("we loaded %d web tools events", webToolsCount)

var withimage []model.WebToolsEvent
for _, l := range allWebToolsEvents {
if l.LargeImageUploaded != "" {
withimage = append(withimage, l)
}
allWebToolsEvents = withimage
}

contentImagesFromTheDataBase, err := e.app.storage.FindImageItems()
if err != nil {
e.logger.Error("Error on finding image items")
Expand Down

0 comments on commit 7a69889

Please sign in to comment.