mirror of
https://github.com/bettercap/bettercap
synced 2025-07-06 13:02:12 -07:00
misc: added loading boolean flag to api.rest state object
This commit is contained in:
parent
0a31ac8167
commit
a411607a57
2 changed files with 8 additions and 0 deletions
|
@ -30,6 +30,7 @@ type RestAPI struct {
|
|||
|
||||
recording bool
|
||||
recTime int
|
||||
loading bool
|
||||
replaying bool
|
||||
recordFileName string
|
||||
recordWait *sync.WaitGroup
|
||||
|
@ -49,6 +50,7 @@ func NewRestAPI(s *session.Session) *RestAPI {
|
|||
},
|
||||
recording: false,
|
||||
recTime: 0,
|
||||
loading: false,
|
||||
replaying: false,
|
||||
recordFileName: "",
|
||||
recordWait: &sync.WaitGroup{},
|
||||
|
@ -57,6 +59,7 @@ func NewRestAPI(s *session.Session) *RestAPI {
|
|||
|
||||
mod.State.Store("recording", &mod.recording)
|
||||
mod.State.Store("replaying", &mod.replaying)
|
||||
mod.State.Store("loading", &mod.loading)
|
||||
mod.State.Store("rec_time", &mod.recTime)
|
||||
mod.State.Store("rec_filename", &mod.recordFileName)
|
||||
mod.State.Store("rec_frames", 0)
|
||||
|
|
|
@ -25,6 +25,11 @@ func (mod *RestAPI) startReplay(filename string) (err error) {
|
|||
return err
|
||||
}
|
||||
|
||||
mod.loading = true
|
||||
defer func() {
|
||||
mod.loading = false
|
||||
}()
|
||||
|
||||
mod.Info("loading %s ...", mod.recordFileName)
|
||||
|
||||
start := time.Now()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue