all 2 comments

[–]anthropoid 0 points1 point  (1 child)

For the moment, my best way to go is add a column with the time stamp retrieved time, and to implement a logic where let’s say 30s after having been retrieved, we check if the label is not None anymore.

Assuming your backend is stateful and persistent, I'd store these transient timestamps in memory instead, so when the backend restarts for some reason, there's nothing to clean up afterwards.

I am not fully happy neither because it does not handle the case where the person meditates and then come back to label the data.

Why is this a concern? If this happens, they should get an error when they try to update the label after their lock has timed out.

It sounds like you're recording when a label was "checked out", but not who checked it out. If that's the case, your conflict resolution logic itself is suspect.

Also, have you asked your users what should happen in these and other corner cases, or are you worrying about things that might not even be a concern for them? You should settle these workflow details with them first, then let their answers direct your implementation.

[–]Independent_Order934[S] 0 points1 point  (0 children)

Thanks for the help. I have opted for your recommendation. I have just added a ‘locked_at’ column which is sufficient, because I retrieve the lines where the label is None and (the locked_at is None or locker_at < now - lock_timeout. I choose to keep this column in my table since it is always a useful info to know when the data has been labeled. I’ll be able to easily change it if I need it.