Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
finishing touches
Browse files Browse the repository at this point in the history
  • Loading branch information
lostman committed Oct 17, 2023
1 parent 5c5daee commit da95581
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 6 additions & 2 deletions packages/fuel-indexer-database/postgres/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,6 @@ pub async fn register_indexer(
.bind(identifier)
.bind(pubkey)
.bind(created_at)
.bind("registered")
.bind("")
.fetch_one(conn)
.await?;

Expand Down Expand Up @@ -916,6 +914,8 @@ pub async fn put_many_to_many_record(
Ok(())
}

/// Create a database trigger on the indexer's indexmetadataentity table that
/// ensures no blocks can be missing.
pub async fn create_ensure_block_height_consecutive_trigger(
conn: &mut PoolConnection<Postgres>,
namespace: &str,
Expand Down Expand Up @@ -962,6 +962,8 @@ pub async fn create_ensure_block_height_consecutive_trigger(
Ok(())
}

/// When -allow-non-sequential-blocks is set, we need to remove the trigger from
/// indexer's indexmetadataentity table.
pub async fn remove_ensure_block_height_consecutive_trigger(
conn: &mut PoolConnection<Postgres>,
namespace: &str,
Expand All @@ -976,6 +978,7 @@ pub async fn remove_ensure_block_height_consecutive_trigger(
Ok(())
}

/// Set the status of a registered indexers to be displayed by `forc index status`.
pub async fn set_indexer_status(
conn: &mut PoolConnection<Postgres>,
namespace: &str,
Expand All @@ -999,6 +1002,7 @@ pub async fn set_indexer_status(
Ok(())
}

/// Fetch the statuses of all registered indexers.
pub async fn all_registered_indexer_statuses(
conn: &mut PoolConnection<Postgres>,
) -> sqlx::Result<HashMap<(String, String), IndexerStatus>> {
Expand Down
1 change: 0 additions & 1 deletion packages/fuel-indexer-database/src/queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,6 @@ pub async fn set_indexer_status(
identifier: &str,
status: IndexerStatus,
) -> sqlx::Result<()> {
println!("Indexer({namespace}.{identifier}) status: {status:?}");
match conn {
IndexerConnection::Postgres(ref mut c) => {
postgres::set_indexer_status(c, namespace, identifier, status).await
Expand Down

0 comments on commit da95581

Please sign in to comment.