]> git.mjollnir.org Git - moodle.git/commit
accesslib: get_dirty_contexts() - fix race condition, forget about CAST()s
authormartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:56:30 +0000 (07:56 +0000)
committermartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:56:30 +0000 (07:56 +0000)
commit70981363bfd82165896bd345a2e2d8e853ec1a1e
treecadf427836241d52de7c9fea62c28acfb0f15d10
parent99be2a7fad15ac09b095a3773ce8e0297f689a5c
accesslib: get_dirty_contexts() - fix race condition, forget about CAST()s

In one tiny patch we do two things.

First, we fix the race condition around dirty context and accessdata
timestamps -- it is saner to offset the check than to offset the
recording of the change (as an earlier patch did).

    On a cluster, you still need NTP.

Second, we do away with CAST(). Ideally, the values should be compared
as ints but it's hard to get a CAST() syntax that is portable enough
to work on all our supported DBs. And Eloy pointed out (and I
corroborated testing) that we'll never have problems with the string
length, as our timestamps are always 10 chars as a string... and the
day they go to 11 chars we'll hit the unix Year-2038 bug.
lib/accesslib.php