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