Skip to content

Commit

Permalink
Merge pull request #169 from hotosm/fix/task_id_null
Browse files Browse the repository at this point in the history
Fix : Null log
  • Loading branch information
kshitijrajsharma authored Oct 3, 2023
2 parents 6fda004 + cb11701 commit 7ec1f77
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion backend/core/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ def train_model(
try:
## -----------IMAGE DOWNLOADER---------
os.makedirs(settings.LOG_PATH, exist_ok=True)

if training_instance.task_id is None or training_instance.task_id.strip() == '':
training_instance.task_id=train_model.request.id
training_instance.save()
log_file = os.path.join(
settings.LOG_PATH, f"run_{train_model.request.id}_log.txt"
)
Expand Down

0 comments on commit 7ec1f77

Please sign in to comment.