Fix docker i guess?!?

This commit is contained in:
Keroosha 2023-03-07 02:46:50 +03:00
parent eb79887063
commit 8ace6ca157

View File

@ -1,5 +1,6 @@
open System
open System.Net.Http
open System.Threading
open System.Threading.Tasks
open PublishHelperBot.Environment
open PublishHelperBot.YoutubeDl
@ -9,8 +10,8 @@ open Telegram.Bot.Polling
open Telegram.Bot.Types
open Telegram.Bot.Types.Enums
let cancellation = new CancellationTokenSource()
let config = createConfig "SBPB_CONFIG_PATH"
let botClient = TelegramBotClient (config.token, new HttpClient())
let youtubeDlClient =
@ -56,5 +57,9 @@ botClient.StartReceiving(
)
Logging.logger.Information("Я родился")
Console.ReadKey() |> ignore
Console.CancelKeyPress |> Event.add (fun _ -> cancellation.Cancel(); printfn "Сворачиваемся...")
Async.RunSynchronously(
async {
while (not(cancellation.Token.IsCancellationRequested)) do
do! Async.Sleep 500 |> Async.Ignore
})