improve startup
bug fix
This commit is contained in:
parent
53778a3e4e
commit
f2d9d1a486
1 changed files with 6 additions and 2 deletions
|
@ -326,20 +326,20 @@ func (s *Sync) setChannelTerminationStatus(e *error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Sync) waitForDaemonStart() error {
|
func (s *Sync) waitForDaemonStart() error {
|
||||||
|
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-s.grp.Ch():
|
case <-s.grp.Ch():
|
||||||
return errors.Err("interrupted during daemon startup")
|
return errors.Err("interrupted during daemon startup")
|
||||||
default:
|
default:
|
||||||
s, err := s.daemon.Status()
|
s, err := s.daemon.Status()
|
||||||
if err == nil && s.StartupStatus.Wallet {
|
if err == nil && s.StartupStatus.Wallet && s.StartupStatus.FileManager {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
time.Sleep(5 * time.Second)
|
time.Sleep(5 * time.Second)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Sync) stopAndUploadWallet(e *error) {
|
func (s *Sync) stopAndUploadWallet(e *error) {
|
||||||
log.Printf("Stopping daemon")
|
log.Printf("Stopping daemon")
|
||||||
shutdownErr := stopDaemonViaSystemd()
|
shutdownErr := stopDaemonViaSystemd()
|
||||||
|
@ -446,6 +446,10 @@ func (s *Sync) doSync() error {
|
||||||
}
|
}
|
||||||
if hasDupes {
|
if hasDupes {
|
||||||
SendInfoToSlack("Channel had dupes and was fixed!")
|
SendInfoToSlack("Channel had dupes and was fixed!")
|
||||||
|
err = s.waitForNewBlock()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
claims, err = s.daemon.ClaimListMine()
|
claims, err = s.daemon.ClaimListMine()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Prefix("cannot list claims: ", err)
|
return errors.Prefix("cannot list claims: ", err)
|
||||||
|
|
Loading…
Add table
Reference in a new issue