mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 03:59:56 +00:00
Do not repost failed jobs
Failures should not happen except for some weird corner cases. Retrying is unlikely to help in such situation.
This commit is contained in:
parent
d6f3d34f2f
commit
17bd571a65
2 changed files with 2 additions and 23 deletions
|
@ -343,7 +343,8 @@ namespace DetourNavigator
|
|||
removeJob(job);
|
||||
break;
|
||||
case JobStatus::Fail:
|
||||
repost(job);
|
||||
unlockTile(job->mId, job->mAgentBounds, job->mChangedTile);
|
||||
removeJob(job);
|
||||
break;
|
||||
case JobStatus::MemoryCacheMiss:
|
||||
{
|
||||
|
@ -608,26 +609,6 @@ namespace DetourNavigator
|
|||
writeToFile(shared->lockConst()->getImpl(), mSettings.get().mNavMeshPathPrefix, navMeshRevision);
|
||||
}
|
||||
|
||||
void AsyncNavMeshUpdater::repost(JobIt job)
|
||||
{
|
||||
unlockTile(job->mId, job->mAgentBounds, job->mChangedTile);
|
||||
|
||||
if (mShouldStop || job->mTryNumber > 2)
|
||||
return;
|
||||
|
||||
const std::lock_guard<std::mutex> lock(mMutex);
|
||||
|
||||
if (mPushed.emplace(job->mAgentBounds, job->mChangedTile).second)
|
||||
{
|
||||
++job->mTryNumber;
|
||||
insertPrioritizedJob(job, mWaiting);
|
||||
mHasJob.notify_all();
|
||||
return;
|
||||
}
|
||||
|
||||
mJobs.erase(job);
|
||||
}
|
||||
|
||||
bool AsyncNavMeshUpdater::lockTile(
|
||||
std::size_t jobId, const AgentBounds& agentBounds, const TilePosition& changedTile)
|
||||
{
|
||||
|
|
|
@ -197,8 +197,6 @@ namespace DetourNavigator
|
|||
|
||||
void writeDebugFiles(const Job& job, const RecastMesh* recastMesh) const;
|
||||
|
||||
void repost(JobIt job);
|
||||
|
||||
bool lockTile(std::size_t jobId, const AgentBounds& agentBounds, const TilePosition& changedTile);
|
||||
|
||||
void unlockTile(std::size_t jobId, const AgentBounds& agentBounds, const TilePosition& changedTile);
|
||||
|
|
Loading…
Reference in a new issue