mirror of
https://github.com/bettercap/bettercap
synced 2025-07-30 11:40:33 -07:00
refact: refactored module status checks in Configure methods for consistency
This commit is contained in:
parent
a8e6b497a3
commit
1e7d99433e
13 changed files with 52 additions and 53 deletions
|
@ -59,7 +59,9 @@ func (t *Ticker) Configure() error {
|
|||
var commands string
|
||||
var period int
|
||||
|
||||
if err, commands = t.StringParam("ticker.commands"); err != nil {
|
||||
if t.Running() == true {
|
||||
return session.ErrAlreadyStarted
|
||||
} else if err, commands = t.StringParam("ticker.commands"); err != nil {
|
||||
return err
|
||||
} else if err, period = t.IntParam("ticker.period"); err != nil {
|
||||
return err
|
||||
|
@ -72,9 +74,7 @@ func (t *Ticker) Configure() error {
|
|||
}
|
||||
|
||||
func (t *Ticker) Start() error {
|
||||
if t.Running() == true {
|
||||
return session.ErrAlreadyStarted
|
||||
} else if err := t.Configure(); err != nil {
|
||||
if err := t.Configure(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue