Skip to content

Commit

Permalink
skip run scheduled job on start (fixes #25)
Browse files Browse the repository at this point in the history
  • Loading branch information
reddec committed Dec 29, 2023
1 parent d549807 commit 314f3d9
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions application/cases/cases.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ package cases
import (
"context"
"fmt"
"github.com/google/uuid"
"github.com/reddec/trusted-cgi/application"
"github.com/reddec/trusted-cgi/application/lambda"
"github.com/reddec/trusted-cgi/templates"
"github.com/reddec/trusted-cgi/types"
"io/ioutil"
"log"
"os"
"path/filepath"
"time"

"github.com/google/uuid"
"github.com/reddec/trusted-cgi/application"
"github.com/reddec/trusted-cgi/application/lambda"
"github.com/reddec/trusted-cgi/templates"
"github.com/reddec/trusted-cgi/types"
)

func New(platform application.Platform, queues application.Queues, policies application.Policies, dir, templateDir string) (*casesImpl, error) {
Expand All @@ -25,11 +26,12 @@ func New(platform application.Platform, queues application.Queues, policies appl
return nil, fmt.Errorf("resolve root dir: %w", err)
}
cs := &casesImpl{
directory: aDir,
templatesDir: aTemplateDir,
platform: platform,
queues: queues,
policies: policies,
directory: aDir,
templatesDir: aTemplateDir,
platform: platform,
queues: queues,
policies: policies,
lastScheduler: time.Now(), // avoid running scheduled tasks immediately
}
return cs, cs.Scan()
}
Expand Down

0 comments on commit 314f3d9

Please sign in to comment.