Families.Web 1.0.0.0
사진, 동영상, 글, 댓글과 반응을 가족끼리만 공유하는 비공개 앨범·타임라인 서비스입니다.
로딩중...
검색중...
일치하는것 없음
FamiliesApp.Services.GhostAccountCleanupService 클래스 참조sealed

더 자세히 ...

FamiliesApp.Services.GhostAccountCleanupService에 대한 상속 다이어그램 :
FamiliesApp.Services.GhostAccountCleanupService에 대한 협력 다이어그램:

Public 멤버 함수

 GhostAccountCleanupService (IFamilyTenantStore tenants, IPostStore posts, ILogger< GhostAccountCleanupService > logger)

Protected 멤버 함수

override async Task ExecuteAsync (CancellationToken stoppingToken)

Private 멤버 함수

async Task RunCleanupAsync (CancellationToken ct)

Private 속성

readonly IFamilyTenantStore _tenants
readonly IPostStore _posts
readonly ILogger< GhostAccountCleanupService_logger

정적 Private 속성

static readonly TimeSpan Interval = TimeSpan.FromHours(1)
static readonly TimeSpan GracePeriod = TimeSpan.FromHours(24)

상세한 설명

포스트 없이 24시간 이상 방치된 계정을 자동 삭제합니다.

GhostAccountCleanupService.cs 파일의 14 번째 라인에서 정의되었습니다.

생성자 & 소멸자 문서화

◆ GhostAccountCleanupService()

FamiliesApp.Services.GhostAccountCleanupService.GhostAccountCleanupService ( IFamilyTenantStore tenants,
IPostStore posts,
ILogger< GhostAccountCleanupService > logger )
inline

지정한 설정으로 GhostAccountCleanupService 클래스의 새 인스턴스를 초기화합니다.

매개변수
tenantstenants에 사용할 IFamilyTenantStore 값입니다.
postsposts에 사용할 IPostStore 값입니다.
loggerlogger에 사용할 ILogger<GhostAccountCleanupService> 값입니다.

GhostAccountCleanupService.cs 파일의 94 번째 라인에서 정의되었습니다.

96 {
97 _tenants = tenants;
98 _posts = posts;
99 _logger = logger;
100 }

다음을 참조함 : _logger, _posts, _tenants.

멤버 함수 문서화

◆ ExecuteAsync()

override async Task FamiliesApp.Services.GhostAccountCleanupService.ExecuteAsync ( CancellationToken stoppingToken)
inlineprotected

Execute Async 작업을 수행합니다.

매개변수
stoppingTokenstopping Token에 사용할 CancellationToken 값입니다.
반환값
Execute Async 작업에서 생성한 Task 결과입니다.

GhostAccountCleanupService.cs 파일의 126 번째 라인에서 정의되었습니다.

127 {
128 while (!stoppingToken.IsCancellationRequested)
129 {
130 await Task.Delay(Interval, stoppingToken).ConfigureAwait(false);
131 await RunCleanupAsync(stoppingToken).ConfigureAwait(false);
132 }
133 }

다음을 참조함 : Interval, RunCleanupAsync().

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ RunCleanupAsync()

async Task FamiliesApp.Services.GhostAccountCleanupService.RunCleanupAsync ( CancellationToken ct)
inlineprivate

Run Cleanup Async 작업을 수행합니다.

매개변수
ct취소 요청을 감시하는 토큰입니다.
반환값
Run Cleanup Async 작업에서 생성한 Task 결과입니다.

GhostAccountCleanupService.cs 파일의 159 번째 라인에서 정의되었습니다.

160 {
161 try
162 {
163 var all = await _tenants.GetAllAsync(ct).ConfigureAwait(false);
164 var cutoff = DateTime.Now - GracePeriod;
165
166 foreach (var t in all)
167 {
168 if (t.CreatedAt > cutoff) continue;
169
170 var postList = await _posts.GetAllAsync(t.Slug, ct).ConfigureAwait(false);
171 if (postList.Count > 0) continue;
172
173 await _tenants.DeleteAsync(t.Slug, ct).ConfigureAwait(false);
174 _logger.LogInformation("고스트 계정 자동 삭제: {Slug} (생성: {CreatedAt:g}, 포스트 0개)", t.Slug, t.CreatedAt);
175 }
176 }
177 catch (Exception ex) when (ex is not OperationCanceledException)
178 {
179 _logger.LogError(ex, "고스트 계정 정리 중 오류 발생");
180 }
181 }

다음을 참조함 : _logger, _posts, _tenants, GracePeriod.

다음에 의해서 참조됨 : ExecuteAsync().

이 함수를 호출하는 함수들에 대한 그래프입니다.:

멤버 데이터 문서화

◆ _logger

readonly ILogger<GhostAccountCleanupService> FamiliesApp.Services.GhostAccountCleanupService._logger
private

logger 값을 보관합니다.

GhostAccountCleanupService.cs 파일의 42 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : GhostAccountCleanupService(), RunCleanupAsync().

◆ _posts

readonly IPostStore FamiliesApp.Services.GhostAccountCleanupService._posts
private

posts 값을 보관합니다.

GhostAccountCleanupService.cs 파일의 33 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : GhostAccountCleanupService(), RunCleanupAsync().

◆ _tenants

readonly IFamilyTenantStore FamiliesApp.Services.GhostAccountCleanupService._tenants
private

tenants 값을 보관합니다.

GhostAccountCleanupService.cs 파일의 24 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : GhostAccountCleanupService(), RunCleanupAsync().

◆ GracePeriod

readonly TimeSpan FamiliesApp.Services.GhostAccountCleanupService.GracePeriod = TimeSpan.FromHours(24)
staticprivate

Grace Period 값을 보관합니다.

GhostAccountCleanupService.cs 파일의 60 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : RunCleanupAsync().

◆ Interval

readonly TimeSpan FamiliesApp.Services.GhostAccountCleanupService.Interval = TimeSpan.FromHours(1)
staticprivate

Interval 값을 보관합니다.

GhostAccountCleanupService.cs 파일의 51 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : ExecuteAsync().


이 클래스에 대한 문서화 페이지는 다음의 파일로부터 생성되었습니다.: