Skip to content

Commit 9a4bd61

Browse files
author
Bhargav Dodla
committed
fix: Removed rate limiting
1 parent a29b5ae commit 9a4bd61

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

sdk/python/feast/infra/online_stores/contrib/cassandra_online_store/cassandra_online_store.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def allow(self) -> bool:
231231
return False
232232

233233
def __enter__(self):
234-
"""Ctimext manager entry: Wait until a token is available."""
234+
"""Context manager entry: Wait until a token is available."""
235235
while not self.allow():
236236
time.sleep(0.01) # Small delay to prevent busy-waiting
237237
return self
@@ -414,7 +414,7 @@ def on_failure(exc, semaphore, futures, future, lock):
414414

415415
write_concurrency = config.online_store.write_concurrency
416416

417-
rate_limiter = RateLimiter(rate=write_concurrency, interval=1)
417+
# rate_limiter = RateLimiter(rate=write_concurrency, interval=1)
418418
semaphore = threading.Semaphore(write_concurrency)
419419
lock = threading.Lock()
420420

@@ -451,26 +451,26 @@ def on_failure(exc, semaphore, futures, future, lock):
451451
timestamp,
452452
)
453453
batch.add(insert_cql, params)
454-
with rate_limiter:
455-
semaphore.acquire()
456-
future = session.execute_async(batch)
457-
futures.append(future)
458-
future.add_callbacks(
459-
partial(
460-
on_success,
461-
semaphore=semaphore,
462-
futures=futures,
463-
future=future,
464-
lock=lock,
465-
),
466-
partial(
467-
on_failure,
468-
semaphore=semaphore,
469-
futures=futures,
470-
future=future,
471-
lock=lock,
472-
),
473-
)
454+
# with rate_limiter:
455+
semaphore.acquire()
456+
future = session.execute_async(batch)
457+
futures.append(future)
458+
future.add_callbacks(
459+
partial(
460+
on_success,
461+
semaphore=semaphore,
462+
futures=futures,
463+
future=future,
464+
lock=lock,
465+
),
466+
partial(
467+
on_failure,
468+
semaphore=semaphore,
469+
futures=futures,
470+
future=future,
471+
lock=lock,
472+
),
473+
)
474474

475475
# TODO: Make this efficient by leveraging continuous writes rather
476476
# than blocking until all writes are done. We may need to rate limit

0 commit comments

Comments
 (0)