コード例 #1
0
ファイル: TokenCleanupService.cs プロジェクト: younes21/abp
    protected virtual async Task RemoveDeviceCodesAsync()
    {
        for (var i = 0; i < Options.CleanupLoopCount; i++)
        {
            var deviceFlowCodeses = await DeviceFlowCodesRepository.GetListByExpirationAsync(DateTime.UtcNow, Options.CleanupBatchSize);

            await DeviceFlowCodesRepository.DeleteManyAsync(deviceFlowCodeses);

            //No need to continue to query if it gets more than max items.
            if (deviceFlowCodeses.Count < Options.CleanupBatchSize)
            {
                break;
            }
        }
    }
コード例 #2
0
ファイル: TokenCleanupService.cs プロジェクト: zjc-china/abp
        protected virtual async Task RemoveDeviceCodesAsync()
        {
            for (int i = 0; i < Options.CleanupLoopCount; i++)
            {
                var deviceFlowCodeses = await DeviceFlowCodesRepository
                                        .GetListByExpirationAsync(Clock.Now, Options.CleanupBatchSize);

                //TODO: Can be optimized if the repository implements the batch deletion
                foreach (var deviceFlowCodes in deviceFlowCodeses)
                {
                    await DeviceFlowCodesRepository
                    .DeleteAsync(deviceFlowCodes);
                }

                //No need to continue to query if it gets more than max items.
                if (deviceFlowCodeses.Count < Options.CleanupBatchSize)
                {
                    break;
                }
            }
        }