When I execute the following code inside a hangfire job, the batch continuation from function1 all the way to function4 executes in sequence as expected. When I execute the same code in a console app, only Function1 executes in hangfire and the remaining three functions are stuck in awaiting status. Why? Is it because the console app ends before the hangfire batch is completely setup?
parentHangfireJobId = BatchJob.StartNew(Sub(x)
x.Enqueue(Sub() Function1()
End Sub, batchJobDescription1)
hangfireJobId = BatchJob.ContinueBatchWith(parentHangfireJobId,
Sub(x)
x.Enqueue(Sub() Function2()
End Sub, batchJobDescription2)
hangfireJobId = BatchJob.ContinueBatchWith(hangfireJobId ,
Sub(x)
x.Enqueue(Sub() Function3()
End Sub, batchJobDescription3)
hangfireJobId = BatchJob.ContinueBatchWith(hangfireJobId ,
Sub(x)
x.Enqueue(Sub() Function4()
End Sub, batchJobDescription4)