Add marker file for project store oplog in Saved/Cooked/<platform> folder so Zen can check if an oplog should be garbage collected.

Companion Zen PR: https://github.com/EpicGames/zen/pull/209

#preflight 63971e55cb2317695e180344

[CL 23510788 by dan engelbrecht in ue5-main branch]
This commit is contained in:
dan engelbrecht
2022-12-14 07:18:38 -05:00
parent bc786b8355
commit e018c47697
4 changed files with 24 additions and 8 deletions

View File

@@ -364,7 +364,8 @@ void FZenStoreWriter::Initialize(const FCookInfo& Info)
if (!bInitialized)
{
if (Info.bFullBuild && !Info.bWorkerOnSharedSandbox)
bool CleanBuild = Info.bFullBuild && !Info.bWorkerOnSharedSandbox;
if (CleanBuild)
{
UE_LOG(LogZenStoreWriter, Display, TEXT("Deleting %s..."), *OutputPath);
const bool bRequireExists = false;
@@ -372,7 +373,16 @@ void FZenStoreWriter::Initialize(const FCookInfo& Info)
IFileManager::Get().DeleteDirectory(*OutputPath, bRequireExists, bTree);
}
bool bOplogEstablished = HttpClient->TryCreateOplog(ProjectId, OplogId, Info.bFullBuild);
FString OplogLifetimeMarkerPath = OutputPath / (ProjectId + TEXT(".") + OplogId + TEXT(".projectstore"));
TUniquePtr<FArchive> OplogMarker(IFileManager::Get().CreateFileWriter(*OplogLifetimeMarkerPath));
bool bOplogEstablished = HttpClient->TryCreateOplog(ProjectId, OplogId, OplogLifetimeMarkerPath, Info.bFullBuild);
OplogMarker.Reset();
if (!bOplogEstablished && CleanBuild)
{
IFileManager::Get().Delete(*OplogLifetimeMarkerPath);
}
UE_CLOG(!bOplogEstablished, LogZenStoreWriter, Fatal, TEXT("Failed to establish oplog on the ZenServer"));
if (!Info.bFullBuild)