Skip to content

Commit

Permalink
feat: add NoUpdateCheck option
Browse files Browse the repository at this point in the history
  • Loading branch information
dwisiswant0 committed Feb 27, 2023
1 parent b998626 commit b1c956b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ type Options struct {
// By default, log messages are printed to stderr (false).
NoStderr bool

// NoUpdateCheck is a boolean flag indicating whether or not to disable automatic threat
// dataset updates. When set to true, automatic updates will be disabled. If set to false,
// automatic updates will be enabled. By default, automatic updates are enabled (false).
NoUpdateCheck bool

// Development is a boolean flag that determines whether the request is cached or not.
// By default, development mode is disabled (false) or requests will cached.
Development bool
Expand Down
4 changes: 2 additions & 2 deletions teler.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ func (t *Teler) getResources() error {
}

// Download the datasets of threat ruleset from teler-resources
// if threat datasets is not up-to-date
if !updated {
// if threat datasets is not up-to-date and NoUpdateCheck is false
if !updated && !t.opt.NoUpdateCheck {
if err := threat.Get(); err != nil {
return err
}
Expand Down

0 comments on commit b1c956b

Please sign in to comment.