Revert "清理"
猿人易 authored at 2024-06-17 16:53:31
830.00 B
Stardust
using System.Threading;
using System.Threading.Tasks;
using Stardust.Data;

namespace StarGateway
{
    class InitService : IHostedService
    {
        public Task StartAsync(CancellationToken cancellationToken)
        {
            //await Task.Yield();

            Task.Run(() =>
            {
                // 配置
                var set = NewLife.Setting.Current;
                if (set.IsNew)
                {
                    set.DataPath = "../Data";
                    set.Save();
                }

                // 初始化数据库
                var n = App.Meta.Count;
                //AppStat.Meta.Session.Dal.Db.ShowSQL = false;
            });

            return Task.CompletedTask;
        }

        public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask;
    }
}