Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Потенциальная проблема из-за отсутствия обработки возвращаемых значений #1

Open
a-khakimov opened this issue Dec 7, 2020 · 0 comments
Assignees
Labels
invalid This doesn't seem right

Comments

@a-khakimov
Copy link
Owner

private def takeProfit(op: BotOperation, candle: CandlePayload): F[Unit] = {
for {
_ <- Sync[F].delay(log.info(s"Running take profit operation for $candle"))
_ <- notificationRepo.push(Notification(op.tgUserId,
s"[${op.id.getOrElse(-1)}] Продажа акций ${op.figi} по событию TakeProfit(${op.takeProfit}) по цене ${candle.c}")
)
_ <- dbAccess.updateOperationStatus(op.id.get, OperationStatus.Running)
_ <- dbAccess.insertCandle(candle)
} yield ()
}
}

Если при выполнении, например строки _ <- notificationRepo.push(...) произойдет ошибка, то последующие строки не будут выполнены и то, что произошла ошибка мы не узнаем, или узнаем но поздно.

@a-khakimov a-khakimov added the invalid This doesn't seem right label Dec 7, 2020
@a-khakimov a-khakimov self-assigned this Dec 7, 2020
@a-khakimov a-khakimov changed the title Потенциальная проблема из-за отсутсвия обработки возвращаемых значений Потенциальная проблема из-за отсутствия обработки возвращаемых значений Dec 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant