def Limit(key):
		current_limits = rl_db.limits.find({"Key": key}, {"Max": 1, "Count": 1})
		for limit in current_limits:
			if limit["Count"] < limit["Max"]:
				# We can't continue without exceeding this limit
				# Don't want to halt the synchronization worker to wait for 15min-1 hour
				# So...
				raise RateLimitExceededException()
		rl_db.limits.update({"Key": key}, {"$inc": {"Count": 1}}, multi=True)
dataset/ETHPy150Open cpfair/tapiriik/tapiriik/services/ratelimiting.py/RateLimit.Limit/swapped operands of `<`