Skip to content

Commit

Permalink
Always load script prior to executing
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Snaps <alex@wcgw.dev>

Signed-off-by: Alex Snaps <alex@wcgw.dev>
  • Loading branch information
alexsnaps committed Oct 8, 2024
1 parent fce468e commit 30d2f15
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion limitador/src/storage/redis/redis_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ impl AsyncCounterStorage for AsyncRedisStorage {
}

let script = redis::Script::new(SCRIPT_UPDATE_COUNTER);
script.prepare_invoke().load_async(&mut con).await?;
let mut pipeline = redis::pipe();
let mut pipeline = &mut pipeline;
for (counter_idx, key) in counter_keys.iter().enumerate() {
Expand All @@ -125,7 +126,7 @@ impl AsyncCounterStorage for AsyncRedisStorage {
.arg(counter.window().as_secs())
.arg(delta),
)
.ignore();
.ignore()
}
pipeline
.query_async::<()>(&mut con)
Expand Down

0 comments on commit 30d2f15

Please sign in to comment.