Hi,
I had a strange error error - (1406, "Data too long for column 'desc' at row 1")
After browsing the net, and then exploring the code of huey-monitor,
I finally manage to realize the reason my task was failling was that the description I was setting for my ProcessInfo was 67 char while only 64 were authorized by the TaskModel model.
This error was quite small, and may happen easily ... but it was quite hard to find-out.
I therefore would suggest to make this error much more easy to find-out for users.
One solution could be to implement a custom validator for the TaskModel.desc field to document specifically the error for the user.
However, having a desc bigger than 64 char should not for me prevent a task to run.
I would therefore suggest another simpler solution:
to implement in the ProcessInfo model a crop to 64 char when updating TaskModel.
A minimal implementation could be:
TaskModel.objects.filter(task_id=task.id).update(
desc=self.desc[:64],
total=self.total,
unit=self.unit,
unit_divisor=self.unit_divisor,
)
Hi,
I had a strange error
error - (1406, "Data too long for column 'desc' at row 1")After browsing the net, and then exploring the code of huey-monitor,
I finally manage to realize the reason my task was failling was that the description I was setting for my
ProcessInfowas 67 char while only 64 were authorized by theTaskModelmodel.This error was quite small, and may happen easily ... but it was quite hard to find-out.
I therefore would suggest to make this error much more easy to find-out for users.
One solution could be to implement a custom validator for the
TaskModel.descfield to document specifically the error for the user.However, having a
descbigger than 64 char should not for me prevent a task to run.I would therefore suggest another simpler solution:
to implement in the
ProcessInfomodel a crop to 64 char when updatingTaskModel.A minimal implementation could be: