chore: started working on #38

This commit is contained in:
2023-10-10 12:28:49 +01:00
parent 1229ad5373
commit b6afecc682
8 changed files with 225 additions and 137 deletions

View File

@@ -137,9 +137,13 @@ func processZipFile(c *Context, model *BaseModel) {
f.Write(file_data)
if !testImgForModel(c, model, file_path) {
c.Logger.Errorf("Image did not have valid format for model %s\n", file_path)
ModelUpdateStatus(c, model.Id, FAILED_PREPARING_ZIP_FILE)
return
c.Logger.Errorf("Image did not have valid format for model %s (in zip: %s)!", file_path, file.Name)
c.Logger.Warn("Not failling updating data point to status -1")
message := "Image did not have valid format for the model"
if err = model_classes.UpdateDataPointStatus(c.Db, data_point_id, -1, &message); err != nil {
c.Logger.Error("Failed to update data point status")
ModelUpdateStatus(c, model.Id, FAILED_PREPARING_ZIP_FILE)
}
}
}