3

I manually start thread which runs SignalR on one page. Currently my app is running on two different servers - Contabo and Amazon. Both are windows servers.

I logged the whole process in my database and found out that the thread doesn't start on Amazon server.

 public static void PushOrdersAsync()
    {
        int frequency = ParameterManager.GetInteger("OrderPushingFrequency");

        Task t = Task.Run(() =>
        {
            while (mPush)
            {
            
                Thread.Sleep(frequency * 1000);
                List<vOrder> orders = OrderManager.GetvOrders(OrderStatusEnum.Open);
                List<vOrder> completedOrders = OrderManager.GetCompletedOrdersAll();

                PushOpenOrders(orders);
                PushCompletedOrders(completedOrders);
            }
        });
    }

EDIT : I am manually starting the thread when I start the website

Guga Todua
  • 462
  • 2
  • 11
  • 27
  • I do not think it did not start the the method was called. Either it did error out with an exception or you have another async/await issue somewhere else producing due to a deadlock many pending tasks which prevent your task from running. A memory dump will tell what is going on. – Alois Kraus Dec 02 '20 at 22:17

1 Answers1

0

if your server is a datacentre edition you should check your license, make sure it does not have "activate windows" on the desktop

Mbithy Mbithy
  • 138
  • 13