Exemplo n.º 1
0
        static void Main(string[] args)
        {
            if (StartupHelper.alreadyRunningProcess())
            {
                Environment.Exit(0);
            }

            SyncHelper.SetEnvironmentPaths(FolderConstants.FEEDER_BRIDGE_APP_DATA_FOLDER, FolderConstants.FEEDER_BRIDGE_SYNC_APP_DATA_FOLDER);

            Logging.Logger.Log("INFO", "BRIDGE SYNC LAUNCHED");
            AppDomain.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit;
            tokenSource = new CancellationTokenSource();
            token       = tokenSource.Token;

            Task callTask = Task.Run(async() =>
            {
                System.Threading.Thread.CurrentThread.Priority = ThreadPriority.Lowest;
                var task = new FeederBridgeSyncTask(token);
                await task.DoSync();
            });

            callTask.Wait();
            Environment.Exit(0);
        }