Skip to content

Commit 35fec03

Browse files
authored
Fix gauge for semaphore (#1642)
1 parent e551b94 commit 35fec03

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

telescope/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,11 @@ def metric(self, value):
4444
self._metric = value
4545

4646
async def acquire(self):
47+
# Actually wait until we *have* the semaphore before incrementing the metric.
48+
res = await super().acquire()
4749
if self.metric:
4850
self.metric.inc()
49-
return await super().acquire()
51+
return res
5052

5153
def release(self):
5254
super().release()

0 commit comments

Comments
 (0)