diff --git a/librarejob/rarejob.go b/librarejob/rarejob.go index 6a5906c..8e12c9a 100644 --- a/librarejob/rarejob.go +++ b/librarejob/rarejob.go @@ -209,6 +209,7 @@ func (c *client) Login(ctx context.Context, username, password string) error { func (c *client) ReserveTutor(ctx context.Context, from time.Time, margin time.Duration) (*Reserve, error) { defer zap.L().Sync() + defer c.flushConsoleLogs() // TODO(musaprg): split this function into two @@ -301,8 +302,6 @@ func (c *client) ReserveTutor(ctx context.Context, from time.Time, margin time.D c.saveCurrentScreenshot(rarejobctlTempDir, "reservation_completed.png") zap.L().Debug("reservation completed") - c.flushConsoleLogs() - return &Reserve{ Name: tutors[0].Name, StartAt: tutors[0].AvailableSlots[0],