mozilla-services / mozservices

INACTIVE - http://mzl.la/ghe-archive - Various utilities for Pyramid-based Mozilla applications
33 stars 17 forks source link

Ensure that secrets can't be added more than once per second. #9

Closed rfk closed 12 years ago

rfk commented 12 years ago

The secrets file format only supports one-second resolution, so if you add secrets in quick succession they can get saved/loaded in the wrong order. This was causing sporadic test failures.

This patch causes secrets.add() to fail if you call it in quick succession. Seemed safer than trying to futz the secrets so it succeeds in this never-going-to-happen-in-production case.

rfk commented 12 years ago

(specifically for @tarekziade to make sure I haven't broken anything...)