Skip to content

Commit

Permalink
Added float field, and more comments on the steps of label creation a…
Browse files Browse the repository at this point in the history
…nd saving

Signed-off-by: Aaron Chong <[email protected]>
  • Loading branch information
aaronchongth committed May 20, 2024
1 parent bb95202 commit 7c2d8ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
BigIntField,
CharField,
DatetimeField,
FloatField,
ForeignKeyField,
ForeignKeyRelation,
JSONField,
Expand Down Expand Up @@ -38,6 +39,7 @@ class TaskLabel(Model):
label_name = CharField(255, null=False, index=True)
label_value_str = CharField(255, null=True, index=True)
label_value_num = BigIntField(null=True, index=True)
label_value_float = FloatField(null=True, index=True)


class TaskEventLog(Model):
Expand Down
3 changes: 2 additions & 1 deletion packages/api-server/api_server/repositories/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,11 @@ async def save_task_state(self, task_state: TaskState) -> None:
)
return

# Since this is updating an existing task state, we are done
if not created:
return

# Save the labels that we want
# Labels are created and saved when a new task state is first received
labels = task_state.booking.labels
booking_label = None
if labels is not None:
Expand Down

0 comments on commit 7c2d8ef

Please sign in to comment.