Skip to content

Commit

Permalink
Separate slots
Browse files Browse the repository at this point in the history
  • Loading branch information
jpbogle committed Mar 4, 2023
1 parent 829f15e commit 9257e04
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions src/postgres_client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,17 +211,24 @@ impl PostgresClient for SimplePostgresClient {

// flush slots
let mut measure = Measure::start("geyser-plugin-postgres-flush-slots-us");
let query = &self
.slots_at_startup
.drain()
.map(|s| SlotHandler::update(s, None, SlotStatus::Rooted))
.collect::<Vec<String>>()
.join("");
if let Err(err) = client.batch_execute(&query) {
return Err(GeyserPluginError::Custom(Box::new(GeyserPluginPostgresError::DataSchemaError {
msg: format!("[notify_end_of_startup][flush_slots] error=[{}]", err),
})));
};
for s in &self.slots_at_startup {
if let Err(err) = client.batch_execute(&SlotHandler::update(*s, None, SlotStatus::Rooted)) {
return Err(GeyserPluginError::Custom(Box::new(GeyserPluginPostgresError::DataSchemaError {
msg: format!("[notify_end_of_startup][flush_slots] error=[{}]", err),
})));
};
}
// let query = &self
// .slots_at_startup
// .drain()
// .map(|s| SlotHandler::update(s, None, SlotStatus::Rooted))
// .collect::<Vec<String>>()
// .join("");
// if let Err(err) = client.batch_execute(&query) {
// return Err(GeyserPluginError::Custom(Box::new(GeyserPluginPostgresError::DataSchemaError {
// msg: format!("[notify_end_of_startup][flush_slots] error=[{}]", err),
// })));
// };
measure.stop();

datapoint_info!(
Expand Down

0 comments on commit 9257e04

Please sign in to comment.