worker: Redeclare storage early on reconnect
This commit is contained in:
parent
810c767200
commit
bf554d0e43
@ -428,12 +428,9 @@ var runCmd = &cli.Command{
|
|||||||
go func() {
|
go func() {
|
||||||
var reconnect bool
|
var reconnect bool
|
||||||
for {
|
for {
|
||||||
log.Info("Making sure no local tasks are running")
|
|
||||||
|
|
||||||
// TODO: we could get rid of this, but that requires tracking resources for restarted tasks correctly
|
|
||||||
workerApi.LocalWorker.WaitQuiet()
|
|
||||||
|
|
||||||
if reconnect {
|
if reconnect {
|
||||||
|
log.Info("Redeclaring local storage")
|
||||||
|
|
||||||
if err := localStore.Redeclare(ctx); err != nil {
|
if err := localStore.Redeclare(ctx); err != nil {
|
||||||
log.Errorf("Redeclaring local storage failed: %+v", err)
|
log.Errorf("Redeclaring local storage failed: %+v", err)
|
||||||
cancel()
|
cancel()
|
||||||
@ -441,6 +438,12 @@ var runCmd = &cli.Command{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.Info("Making sure no local tasks are running")
|
||||||
|
|
||||||
|
// TODO: we could get rid of this, but that requires tracking resources for restarted tasks correctly
|
||||||
|
workerApi.LocalWorker.WaitQuiet()
|
||||||
|
|
||||||
|
|
||||||
if err := nodeApi.WorkerConnect(ctx, "ws://"+address+"/rpc/v0"); err != nil {
|
if err := nodeApi.WorkerConnect(ctx, "ws://"+address+"/rpc/v0"); err != nil {
|
||||||
log.Errorf("Registering worker failed: %+v", err)
|
log.Errorf("Registering worker failed: %+v", err)
|
||||||
cancel()
|
cancel()
|
||||||
|
Loading…
Reference in New Issue
Block a user