mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-22 04:32:49 +00:00
feat(ugc): staff reprocessing of a property goes to the front of the queue
/reprocessproperty and the dashboard's Reprocess all models mark the property's models as priority (ugc.priority, migrations mysql 94 and sqlite 77). The UGC server takes priority models first, polls them even when its queue is full, and puts them at its front, as it does cars and rockets. The flag clears once a model is made. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -332,10 +332,13 @@ void UgcProcessor::Poll() {
|
||||
|
||||
std::vector<Job> jobs;
|
||||
std::vector<IUgc::PendingModel> models;
|
||||
// Models staff asked to be made again come first too: polled even when the queue is full, to its front
|
||||
if (limit > 0) models = Database::Get()->GetUgcModelsToProcess(limit);
|
||||
else models = Database::Get()->GetUgcModelsToProcess(buildLimit, true);
|
||||
for (auto& model : models) {
|
||||
if (m_InFlight.contains({ Kind::MODEL, model.id })) continue;
|
||||
Job job{ Kind::MODEL, model.id, model.attempts, UgcJobs::LxfmlFromBlob(model.lxfml) };
|
||||
job.priority = model.priority;
|
||||
if (job.blob.empty()) job.blob = std::move(model.lxfml); // the worker reports it can't be read
|
||||
job.parts = UgcJobs::CountParts(job.blob);
|
||||
job.iconValues = IconValues(UgcIconParams::ModelKind(), UgcIconParams::ModelTarget(model.id));
|
||||
@@ -383,7 +386,7 @@ void UgcProcessor::Poll() {
|
||||
std::lock_guard lock(m_Mutex);
|
||||
for (auto& job : jobs) {
|
||||
if (job.kind == Kind::MODEL) m_InFlight.insert({ job.kind, job.id });
|
||||
if (job.kind == Kind::MODULAR) m_Jobs.push_front(std::move(job));
|
||||
if (job.kind == Kind::MODULAR || job.priority) m_Jobs.push_front(std::move(job));
|
||||
else m_Jobs.push_back(std::move(job));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,6 +157,7 @@ private:
|
||||
bool iconOnly{}; // a model's icon drawn again from its stored .nif
|
||||
bool assembly{}; // with `preview`: answered with the assembled .nif instead of an icon
|
||||
UgcIconParams::Values iconValues; // models: the preset and override (UgcIconParams)
|
||||
bool priority{}; // models staff asked to be made again: queued at the front
|
||||
};
|
||||
|
||||
// A written file's MD5 and size as the client has it after inflating it (from its .checksum)
|
||||
|
||||
Reference in New Issue
Block a user