Some minor conversions
This commit is contained in:
@@ -182,7 +182,7 @@ impl PersistentStatsStorage {
|
||||
pub async fn get_started_sessions_count(
|
||||
&self,
|
||||
start_date: Date,
|
||||
) -> Result<i32, StatsStorageError> {
|
||||
) -> Result<i64, StatsStorageError> {
|
||||
Ok(self
|
||||
.session_manager
|
||||
.get_started_sessions_count(start_date)
|
||||
|
||||
@@ -148,7 +148,7 @@ impl SessionManager {
|
||||
.await
|
||||
}
|
||||
|
||||
pub(crate) async fn get_started_sessions_count(&self, start_date: Date) -> Result<i32> {
|
||||
pub(crate) async fn get_started_sessions_count(&self, start_date: Date) -> Result<i64> {
|
||||
Ok(sqlx::query!(
|
||||
"SELECT COUNT(*) as count FROM sessions_active WHERE date(start_time) = ?",
|
||||
start_date
|
||||
|
||||
@@ -17,7 +17,7 @@ sqlx = { workspace = true, features = [
|
||||
"macros",
|
||||
"migrate",
|
||||
"time",
|
||||
"chrono"
|
||||
# "chrono"
|
||||
] }
|
||||
time = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
|
||||
@@ -92,7 +92,7 @@ impl TicketStorageManager {
|
||||
)
|
||||
.fetch_one(&self.connection_pool)
|
||||
.await
|
||||
.map(|result| result.exists == Some(1))
|
||||
.map(|result| result.exists == 1)
|
||||
}
|
||||
|
||||
pub(crate) async fn remove_binary_ticket_data(
|
||||
|
||||
@@ -111,7 +111,7 @@ impl StorageManager {
|
||||
consensus_address: &str,
|
||||
start_height: i64,
|
||||
end_height: i64,
|
||||
) -> Result<i32, sqlx::Error> {
|
||||
) -> Result<i64, sqlx::Error> {
|
||||
trace!("get_signed_between");
|
||||
let start = Instant::now();
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ impl ScraperStorage {
|
||||
consensus_address: &str,
|
||||
start_height: i64,
|
||||
end_height: i64,
|
||||
) -> Result<i32, ScraperError> {
|
||||
) -> Result<i64, ScraperError> {
|
||||
Ok(self
|
||||
.manager
|
||||
.get_signed_between(consensus_address, start_height, end_height)
|
||||
@@ -182,7 +182,7 @@ impl ScraperStorage {
|
||||
consensus_address: &str,
|
||||
start_time: OffsetDateTime,
|
||||
end_time: OffsetDateTime,
|
||||
) -> Result<i32, ScraperError> {
|
||||
) -> Result<i64, ScraperError> {
|
||||
let Some(block_start) = self.get_first_block_height_after(start_time).await? else {
|
||||
return Ok(0);
|
||||
};
|
||||
|
||||
@@ -747,7 +747,7 @@ impl StorageManager {
|
||||
&self,
|
||||
db_mixnode_id: i64,
|
||||
since: i64,
|
||||
) -> Result<i32, sqlx::Error> {
|
||||
) -> Result<i64, sqlx::Error> {
|
||||
let count = sqlx::query!(
|
||||
r#"
|
||||
SELECT COUNT(*) as count FROM
|
||||
@@ -786,7 +786,7 @@ impl StorageManager {
|
||||
&self,
|
||||
gateway_id: i64,
|
||||
since: i64,
|
||||
) -> Result<i32, sqlx::Error> {
|
||||
) -> Result<i64, sqlx::Error> {
|
||||
let count = sqlx::query!(
|
||||
r#"
|
||||
SELECT COUNT(*) as count FROM
|
||||
@@ -824,7 +824,7 @@ impl StorageManager {
|
||||
)
|
||||
.fetch_one(&self.connection_pool)
|
||||
.await
|
||||
.map(|result| result.exists == Some(1))
|
||||
.map(|result| result.exists == 1)
|
||||
}
|
||||
|
||||
/// Creates new entry for mixnode historical uptime
|
||||
@@ -966,7 +966,7 @@ impl StorageManager {
|
||||
&self,
|
||||
since: i64,
|
||||
until: i64,
|
||||
) -> Result<i32, sqlx::Error> {
|
||||
) -> Result<i64, sqlx::Error> {
|
||||
let count = sqlx::query!(
|
||||
"SELECT COUNT(*) as count FROM monitor_run WHERE timestamp > ? AND timestamp < ?",
|
||||
since,
|
||||
@@ -1227,7 +1227,7 @@ impl StorageManager {
|
||||
.await
|
||||
}
|
||||
|
||||
pub(super) async fn get_mixnode_statuses_count(&self, db_id: i64) -> Result<i32, sqlx::Error> {
|
||||
pub(super) async fn get_mixnode_statuses_count(&self, db_id: i64) -> Result<i64, sqlx::Error> {
|
||||
sqlx::query!(
|
||||
r#"
|
||||
SELECT COUNT(*) as count
|
||||
@@ -1279,7 +1279,7 @@ impl StorageManager {
|
||||
.await
|
||||
}
|
||||
|
||||
pub(super) async fn get_gateway_statuses_count(&self, db_id: i64) -> Result<i32, sqlx::Error> {
|
||||
pub(super) async fn get_gateway_statuses_count(&self, db_id: i64) -> Result<i64, sqlx::Error> {
|
||||
sqlx::query!(
|
||||
r#"
|
||||
SELECT COUNT(*) as count
|
||||
@@ -1341,7 +1341,7 @@ pub(crate) mod v3_migration {
|
||||
sqlx::query!("SELECT EXISTS (SELECT 1 FROM v3_migration_info) AS 'exists'",)
|
||||
.fetch_one(&self.connection_pool)
|
||||
.await
|
||||
.map(|result| result.exists == Some(1))
|
||||
.map(|result| result.exists == 1)
|
||||
}
|
||||
|
||||
pub(crate) async fn set_v3_migration_completion(&self) -> Result<(), sqlx::Error> {
|
||||
|
||||
@@ -679,7 +679,7 @@ impl NymApiStorage {
|
||||
&self,
|
||||
mix_id: NodeId,
|
||||
since: Option<i64>,
|
||||
) -> Result<i32, NymApiStorageError> {
|
||||
) -> Result<i64, NymApiStorageError> {
|
||||
let db_id = self.manager.get_mixnode_database_id(mix_id).await?;
|
||||
|
||||
if let Some(node_id) = db_id {
|
||||
@@ -707,7 +707,7 @@ impl NymApiStorage {
|
||||
&self,
|
||||
identity: &str,
|
||||
since: Option<i64>,
|
||||
) -> Result<i32, NymApiStorageError> {
|
||||
) -> Result<i64, NymApiStorageError> {
|
||||
let node_id = self
|
||||
.manager
|
||||
.get_gateway_database_id_by_identity(identity)
|
||||
|
||||
Reference in New Issue
Block a user