Skip to content

Commit

Permalink
fix: removed logger in cronjobs
Browse files Browse the repository at this point in the history
  • Loading branch information
kyee-rs committed Jul 27, 2023
1 parent 1bda4b9 commit 0a95458
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
7 changes: 5 additions & 2 deletions internal/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,18 @@ func unwrapDefaults(c echo.Context) unwrappedDefaults {
subject := c.FormValue("subject")
html := c.FormValue("stripped-html")
text := convert(html)
atc, _ := strconv.Atoi(c.FormValue("attachment-count"))

atc_str := c.FormValue("attachment-count")

Check warning on line 56 in internal/parser.go

View workflow job for this annotation

GitHub Actions / lint

var-naming: don't use underscores in Go names; var atc_str should be atcStr (revive)
switch {
case len(subject) == 0:
subject = "[No Subject]"
case len(html) == 0:
html = "[No Body]"
case len(atc_str) == 0:
atc_str = "0"
}

atc, _ := strconv.Atoi(atc_str)

return unwrappedDefaults{
Recipients: recipients,
From: from,
Expand Down
8 changes: 0 additions & 8 deletions internal/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ var (
)

func timesReceivedNullification() {
log.WithFields(log.Fields{
"function": "timesReceivedNullification",
}).Infoln("Running a TimesReceived nullification cronjob")

_, err := db.User.Update().Where(user.Paid(false)).SetCounter(0).Save(ctx)
if err != nil {
log.WithFields(log.Fields{
Expand All @@ -46,10 +42,6 @@ func timesReceivedNullification() {
}

func letterNullification() {
log.WithFields(log.Fields{
"function": "letterNullification",
}).Infoln("Running a letter nullification cronjob")

_, err := db.Letter.Delete().Where(letter.CreatedAtLT(time.Now().AddDate(0, 0, -3))).Exec(ctx)
if err != nil {
log.WithFields(log.Fields{
Expand Down

0 comments on commit 0a95458

Please sign in to comment.