Move request counter into State model

This commit is contained in:
Mads Marquart
2019-07-01 13:31:30 +02:00
parent f07122d446
commit 8e7afa2edf
2 changed files with 3 additions and 4 deletions

View File

@@ -12,12 +12,15 @@ class State(object):
fb_dtsg = attr.ib(None)
_revision = attr.ib(None)
_counter = attr.ib(0)
def get_params(self):
if self.fb_dtsg is None:
return {}
self._counter += 1 # TODO: Make this operation atomic / thread-safe
return {
"__a": 1,
"__req": _util.str_base(self._counter, 36),
"__rev": self._revision,
"fb_dtsg": self.fb_dtsg,
}