text stringlengths 70 351k | source stringclasses 4
values |
|---|---|
<|fim_prefix|>
// file: hyperswitch/crates/diesel_models/src/query/file.rs | crate: diesel_models
use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods};
use super::generics;
use crate::{
errors,
file::{FileMetadata, FileMetadataNew, FileMetadataUpdate, FileMetadataUpdateInternal},
s... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/diesel_models/src/query/file.rs | crate: diesel_models
use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods};
use super::generics;
use crate::{
errors,
file::{FileMetadata, FileMetadataNew, FileMetadataUpdate, FileMetadataUpdateInternal},
s... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/diesel_models/src/query/file.rs | crate: diesel_models
use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods};
use super::generics;
use crate::{
errors,
file::{FileMetadata, FileMetadataNew, FileMetadataUpdate, FileMetadataUpdateInternal},
s... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/diesel_models/src/query/file.rs | crate: diesel_models
use diesel::{associations::HasTable, BoolExpressionMethods, ExpressionMethods};
use super::generics;
use crate::{
errors,
file::{FileMetadata, FileMetadataNew, FileMetadataUpdate, FileMetadataUpdateInternal},
s... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/diesel_models/src/query/file.rs | crate: diesel_models
use super::generics;
use crate::{
errors,
file::{FileMetadata, FileMetadataNew, FileMetadataUpdate, FileMetadataUpdateInternal},
schema::file_metadata::dsl,
PgPooledConn, StorageResult,
};
pub async fn inse... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/diesel_models/src/query/user/sample_data.rs | crate: diesel_models
use diesel::{associations::HasTable, debug_query, ExpressionMethods, TextExpressionMethods};
use error_stack::ResultExt;
use router_env::logger;
use crate::schema::{
payment_attempt::dsl as payment_attempt_... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/diesel_models/src/query/user/sample_data.rs | crate: diesel_models
use diesel::{associations::HasTable, debug_query, ExpressionMethods, TextExpressionMethods};
use error_stack::ResultExt;
use router_env::logger;
use crate::schema::{
payment_attempt::dsl as payment_attempt_... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/diesel_models/src/query/user/sample_data.rs | crate: diesel_models
use diesel::{associations::HasTable, debug_query, ExpressionMethods, TextExpressionMethods};
use error_stack::ResultExt;
use router_env::logger;
use crate::{
errors, schema::dispute::dsl as dispute_dsl, use... | ast_fragments |
// file: hyperswitch/crates/diesel_models/src/query/user/sample_data.rs | crate: diesel_models
use diesel::{associations::HasTable, debug_query, ExpressionMethods, TextExpressionMethods};
use error_stack::ResultExt;
use router_env::logger;
use crate::schema::{
payment_attempt::dsl as payment_attempt_dsl, payment_in... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/diesel_models/src/query/user/sample_data.rs | crate: diesel_models
use diesel::{associations::HasTable, debug_query, ExpressionMethods, TextExpressionMethods};
use error_stack::ResultExt;
use router_env::logger;
use crate::schema::{
payment_attempt::dsl as payment_attempt_... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/diesel_models/src/query/user/sample_data.rs | crate: diesel_models
use diesel::{associations::HasTable, debug_query, ExpressionMethods, TextExpressionMethods};
use error_stack::ResultExt;
use router_env::logger;
use crate::schema::{
payment_attempt::dsl as payment_attempt_... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/diesel_models/src/query/user/sample_data.rs | crate: diesel_models
use diesel::{associations::HasTable, debug_query, ExpressionMethods, TextExpressionMethods};
use router_env::logger;
use crate::{
errors, schema::dispute::dsl as dispute_dsl, user, Dispute, DisputeNew, Paym... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/diesel_models/src/query/user/sample_data.rs | crate: diesel_models
use diesel::{associations::HasTable, debug_query, ExpressionMethods, TextExpressionMethods};
use router_env::logger;
use crate::{
errors, schema::dispute::dsl as dispute_dsl, user, Dispute, DisputeNew, Paym... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/diesel_models/src/query/user/sample_data.rs | crate: diesel_models
use diesel::{associations::HasTable, debug_query, ExpressionMethods, TextExpressionMethods};
use router_env::logger;
use crate::{
errors, schema::dispute::dsl as dispute_dsl, user, Dispute, DisputeNew, Paym... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/diesel_models/src/query/user/sample_data.rs | crate: diesel_models
use diesel::{associations::HasTable, debug_query, ExpressionMethods, TextExpressionMethods};
use router_env::logger;
use crate::{
errors, schema::dispute::dsl as dispute_dsl, user, Dispute, DisputeNew, Paym... | ast_fragments |
// file: hyperswitch/crates/scheduler/src/scheduler.rs | crate: scheduler
use std::sync::Arc;
use common_utils::{errors::CustomResult, id_type};
use tokio::sync::mpsc;
use super::env::logger::error;
pub use crate::{
configs::settings::SchedulerSettings,
consumer::{self, workflows},
db::{process_tracker::Pro... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/scheduler.rs | crate: scheduler
use std::sync::Arc;
use common_utils::{errors::CustomResult, id_type};
use tokio::sync::mpsc;
use super::env::logger::error;
pub use crate::{
configs::settings::SchedulerSettings,
consumer::{self, workflows},
db::{proce... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/scheduler.rs | crate: scheduler
pub use crate::{
configs::settings::SchedulerSettings,
consumer::{self, workflows},
db::{process_tracker::ProcessTrackerInterface, queue::QueueInterface},
errors,
flow::SchedulerFlow,
producer,
};
fn as_sche... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/utils.rs | crate: scheduler
fn test_get_delay() {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/utils.rs | crate: scheduler
use common_utils::errors::CustomResult;
pub use diesel_models::process_tracker as storage;
use crate::{
configs::settings::SchedulerSettings, consumer::types::ProcessTrackerBatch, errors,
flow::SchedulerFlow, metrics, Scheduler... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/utils.rs | crate: scheduler
use common_utils::errors::CustomResult;
pub use diesel_models::process_tracker as storage;
use redis_interface::{RedisConnectionPool, RedisEntryId};
use super::{
consumer::{self, types::process_data, workflows},
env::logger,
};... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/utils.rs | crate: scheduler
use common_utils::errors::CustomResult;
pub use diesel_models::process_tracker as storage;
use super::{
consumer::{self, types::process_data, workflows},
env::logger,
};
pub fn get_pcr_payments_retry_schedule_time(
mapping:... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/utils.rs | crate: scheduler
use diesel_models::enums::{self, ProcessTrackerStatus};
pub use diesel_models::process_tracker as storage;
use super::{
consumer::{self, types::process_data, workflows},
env::logger,
};
pub fn get_pm_schedule_time(
mapping:... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/utils.rs | crate: scheduler
pub use diesel_models::process_tracker as storage;
/// Get the delay based on the retry count
pub fn get_delay<'a>(
retry_count: i32,
frequencies: impl IntoIterator<Item = &'a (i32, i32)>,
) -> Option<i32> {
<|fim_suffix|>
<|fi... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/utils.rs | crate: scheduler
use common_utils::errors::CustomResult;
pub use diesel_models::process_tracker as storage;
use super::{
consumer::{self, types::process_data, workflows},
env::logger,
};
pub fn get_pcr_payments_retry_schedule_time(
mapping:... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/utils.rs | crate: scheduler
use common_utils::errors::CustomResult;
pub use diesel_models::process_tracker as storage;
use super::{
consumer::{self, types::process_data, workflows},
env::logger,
};
pub fn get_outgoing_webhook_retry_schedule_time(
mapp... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/utils.rs | crate: scheduler
use diesel_models::enums::{self, ProcessTrackerStatus};
pub use diesel_models::process_tracker as storage;
use super::{
consumer::{self, types::process_data, workflows},
env::logger,
};
pub fn get_pm_schedule_time(
mapping:... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/utils.rs | crate: scheduler
use common_utils::errors::CustomResult;
pub use diesel_models::process_tracker as storage;
use super::{
consumer::{self, types::process_data, workflows},
env::logger,
};
pub fn get_schedule_time(
mapping: process_data::Conn... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/utils.rs | crate: scheduler
pub use diesel_models::process_tracker as storage;
use router_env::{instrument, tracing};
use super::{
consumer::{self, types::process_data, workflows},
env::logger,
};
use crate::{
configs::settings::SchedulerSettings, con... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/utils.rs | crate: scheduler
use std::sync;
use common_utils::errors::CustomResult;
pub use diesel_models::process_tracker as storage;
use error_stack::{report, ResultExt};
use super::{
consumer::{self, types::process_data, workflows},
env::logger,
};
use ... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/utils.rs | crate: scheduler
use common_utils::errors::CustomResult;
pub use diesel_models::process_tracker as storage;
pub fn get_time_from_delta(delta: Option<i32>) -> Option<time::PrimitiveDateTime> {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/utils.rs | crate: scheduler
use common_utils::errors::CustomResult;
pub use diesel_models::process_tracker as storage;
pub fn get_process_tracker_id<'a>(
runner: storage::ProcessTrackerRunner,
task_name: &'a str,
txn_id: &'a str,
merchant_id: &'a ... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/utils.rs | crate: scheduler
pub use diesel_models::process_tracker as storage;
use uuid::Uuid;
use super::{
consumer::{self, types::process_data, workflows},
env::logger,
};
use crate::{
configs::settings::SchedulerSettings, consumer::types::ProcessTr... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/utils.rs | crate: scheduler
use common_utils::errors::CustomResult;
pub use diesel_models::process_tracker as storage;
use crate::{
configs::settings::SchedulerSettings, consumer::types::ProcessTrackerBatch, errors,
flow::SchedulerFlow, metrics, Scheduler... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/utils.rs | crate: scheduler
use common_utils::errors::CustomResult;
pub use diesel_models::process_tracker as storage;
use super::{
consumer::{self, types::process_data, workflows},
env::logger,
};
use crate::{
configs::settings::SchedulerSettings, co... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/utils.rs | crate: scheduler
use common_utils::errors::CustomResult;
use diesel_models::enums::{self, ProcessTrackerStatus};
pub use diesel_models::process_tracker as storage;
use error_stack::{report, ResultExt};
use redis_interface::{RedisConnectionPool, RedisEn... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/db/queue.rs | crate: scheduler
use common_utils::errors::CustomResult;
use redis_interface::{errors::RedisError, RedisEntryId, SetnxReply};
use storage_impl::{mock_db::MockDb, redis::kv_store::RedisConnInterface};
async fn consumer_group_create(
&self,
... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/db/queue.rs | crate: scheduler
use common_utils::errors::CustomResult;
use redis_interface::{errors::RedisError, RedisEntryId, SetnxReply};
async fn get_key(&self, _key: &str) -> CustomResult<Vec<u8>, RedisError> {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/db/queue.rs | crate: scheduler
use common_utils::errors::CustomResult;
use redis_interface::{errors::RedisError, RedisEntryId, SetnxReply};
use storage_impl::{mock_db::MockDb, redis::kv_store::RedisConnInterface};
async fn stream_append_entry(
&self,
... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/db/queue.rs | crate: scheduler
use common_utils::errors::CustomResult;
use redis_interface::{errors::RedisError, RedisEntryId, SetnxReply};
use storage_impl::{mock_db::MockDb, redis::kv_store::RedisConnInterface};
async fn release_pt_lock(&self, _tag: &str, _lock... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/db/queue.rs | crate: scheduler
use common_utils::errors::CustomResult;
use redis_interface::{errors::RedisError, RedisEntryId, SetnxReply};
use storage_impl::{mock_db::MockDb, redis::kv_store::RedisConnInterface};
async fn acquire_pt_lock(
&self,
... | ast_fragments |
// file: hyperswitch/crates/scheduler/src/db/queue.rs | crate: scheduler
use common_utils::errors::CustomResult;
use redis_interface::{errors::RedisError, RedisEntryId, SetnxReply};
use storage_impl::{mock_db::MockDb, redis::kv_store::RedisConnInterface};
async fn consumer_group_create(
&self,
_stream: ... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/db/queue.rs | crate: scheduler
use common_utils::errors::CustomResult;
use diesel_models::process_tracker as storage;
use storage_impl::{mock_db::MockDb, redis::kv_store::RedisConnInterface};
use crate::{errors::ProcessTrackerError, scheduler::Store};
async fn fe... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/db/queue.rs | crate: scheduler
use common_utils::errors::CustomResult;
use redis_interface::{errors::RedisError, RedisEntryId, SetnxReply};
async fn get_key(&self, key: &str) -> CustomResult<Vec<u8>, RedisError> {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
// file: hyperswitch/crates/scheduler/src/db/queue.rs | crate: scheduler
use common_utils::errors::CustomResult;
use redis_interface::{errors::RedisError, RedisEntryId, SetnxReply};
async fn stream_append_entry(
&self,
stream: &str,
entry_id: &RedisEntryId,
fields: Vec<(&str, String)>,
... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/db/queue.rs | crate: scheduler
use common_utils::errors::CustomResult;
use redis_interface::{errors::RedisError, RedisEntryId, SetnxReply};
use router_env::logger;
async fn release_pt_lock(&self, tag: &str, lock_key: &str) -> CustomResult<bool, RedisError> {
<|fi... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/db/queue.rs | crate: scheduler
use common_utils::errors::CustomResult;
use diesel_models::process_tracker as storage;
use crate::{errors::ProcessTrackerError, scheduler::Store};
async fn fetch_consumer_tasks(
&self,
stream_name: &str,
grou... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/db/process_tracker.rs | crate: scheduler
use common_utils::errors::CustomResult;
pub use diesel_models as storage;
use diesel_models::enums as storage_enums;
use error_stack::{report, ResultExt};
use storage_impl::{connection, errors, mock_db::MockDb};
use time::... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/db/process_tracker.rs | crate: scheduler
use common_utils::errors::CustomResult;
pub use diesel_models as storage;
use storage_impl::{connection, errors, mock_db::MockDb};
async fn process_tracker_update_process_status_by_ids(
&self,
_task_ids: Ve... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/db/process_tracker.rs | crate: scheduler
use common_utils::errors::CustomResult;
pub use diesel_models as storage;
use storage_impl::{connection, errors, mock_db::MockDb};
async fn finish_process_with_business_status(
&self,
_this: storage::Proces... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/db/process_tracker.rs | crate: scheduler
use common_utils::errors::CustomResult;
pub use diesel_models as storage;
use storage_impl::{connection, errors, mock_db::MockDb};
use time::PrimitiveDateTime;
async fn retry_process(
&self,
_this: storage:... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/db/process_tracker.rs | crate: scheduler
use common_utils::errors::CustomResult;
pub use diesel_models as storage;
use storage_impl::{connection, errors, mock_db::MockDb};
use time::PrimitiveDateTime;
async fn reset_process(
&self,
_this: storage:... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/db/process_tracker.rs | crate: scheduler
use common_utils::errors::CustomResult;
pub use diesel_models as storage;
use storage_impl::{connection, errors, mock_db::MockDb};
async fn update_process(
&self,
_this: storage::ProcessTracker,
_pr... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/db/process_tracker.rs | crate: scheduler
use common_utils::errors::CustomResult;
pub use diesel_models as storage;
use storage_impl::{connection, errors, mock_db::MockDb};
async fn insert_process(
&self,
new: storage::ProcessTrackerNew,
) -> C... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/db/process_tracker.rs | crate: scheduler
use common_utils::errors::CustomResult;
pub use diesel_models as storage;
use diesel_models::enums as storage_enums;
use storage_impl::{connection, errors, mock_db::MockDb};
use time::PrimitiveDateTime;
async fn find_proce... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/db/process_tracker.rs | crate: scheduler
use common_utils::errors::CustomResult;
use storage_impl::{connection, errors, mock_db::MockDb};
use time::PrimitiveDateTime;
async fn reinitialize_limbo_processes(
&self,
_ids: Vec<String>,
_schedu... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/db/process_tracker.rs | crate: scheduler
use common_utils::errors::CustomResult;
pub use diesel_models as storage;
use error_stack::{report, ResultExt};
use storage_impl::{connection, errors, mock_db::MockDb};
async fn process_tracker_update_process_status_by_ids... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/db/process_tracker.rs | crate: scheduler
use common_utils::errors::CustomResult;
pub use diesel_models as storage;
use diesel_models::enums as storage_enums;
use storage_impl::{connection, errors, mock_db::MockDb};
use crate::{metrics, scheduler::Store};
async fn... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/db/process_tracker.rs | crate: scheduler
use common_utils::errors::CustomResult;
pub use diesel_models as storage;
use diesel_models::enums as storage_enums;
use storage_impl::{connection, errors, mock_db::MockDb};
use time::PrimitiveDateTime;
use crate::{metrics... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/db/process_tracker.rs | crate: scheduler
use common_utils::errors::CustomResult;
pub use diesel_models as storage;
use diesel_models::enums as storage_enums;
use storage_impl::{connection, errors, mock_db::MockDb};
use time::PrimitiveDateTime;
async fn reset_proc... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/db/process_tracker.rs | crate: scheduler
use common_utils::errors::CustomResult;
pub use diesel_models as storage;
use error_stack::{report, ResultExt};
use storage_impl::{connection, errors, mock_db::MockDb};
async fn update_process(
&self,
this:... | ast_fragments |
// file: hyperswitch/crates/scheduler/src/db/process_tracker.rs | crate: scheduler
use common_utils::errors::CustomResult;
pub use diesel_models as storage;
use error_stack::{report, ResultExt};
use storage_impl::{connection, errors, mock_db::MockDb};
async fn insert_process(
&self,
new: storage::Proces... | ast_fragments |
// file: hyperswitch/crates/scheduler/src/db/process_tracker.rs | crate: scheduler
use common_utils::errors::CustomResult;
pub use diesel_models as storage;
use diesel_models::enums as storage_enums;
use error_stack::{report, ResultExt};
use storage_impl::{connection, errors, mock_db::MockDb};
use time::PrimitiveDateTi... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/db/process_tracker.rs | crate: scheduler
use common_utils::errors::CustomResult;
pub use diesel_models as storage;
use error_stack::{report, ResultExt};
use storage_impl::{connection, errors, mock_db::MockDb};
use time::PrimitiveDateTime;
async fn reinitialize_li... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/consumer/workflows.rs | crate: scheduler
use common_utils::errors::CustomResult;
pub use diesel_models::process_tracker as storage;
use diesel_models::process_tracker::business_status;
use router_env::logger;
use crate::{errors, SchedulerSessionState};
pub type W... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/consumer/workflows.rs | crate: scheduler
pub use diesel_models::process_tracker as storage;
pub type WorkflowSelectorFn =
fn(&storage::ProcessTracker) -> Result<(), errors::ProcessTrackerError>;
/// Callback function after successful execution of the `exe... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/consumer/workflows.rs | crate: scheduler
use common_utils::errors::CustomResult;
pub use diesel_models::process_tracker as storage;
use diesel_models::process_tracker::business_status;
use router_env::logger;
use crate::{errors, SchedulerSessionState};
pub type W... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/consumer/workflows.rs | crate: scheduler
use common_utils::errors::CustomResult;
pub use diesel_models::process_tracker as storage;
use crate::{errors, SchedulerSessionState};
pub type WorkflowSelectorFn =
fn(&storage::ProcessTracker) -> Result<(), errors::Pr... | ast_fragments |
// file: hyperswitch/crates/scheduler/src/consumer/workflows.rs | crate: scheduler
pub use diesel_models::process_tracker as storage;
pub type WorkflowSelectorFn =
fn(&storage::ProcessTracker) -> Result<(), errors::ProcessTrackerError>;
/// Callback function after successful execution of the `execute_workflow`
... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/consumer/workflows.rs | crate: scheduler
use common_utils::errors::CustomResult;
pub use diesel_models::process_tracker as storage;
use crate::{errors, SchedulerSessionState};
pub type WorkflowSelectorFn =
fn(&storage::ProcessTracker) -> Result<(), errors::Pr... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/scheduler/src/consumer/workflows.rs | crate: scheduler
use common_utils::errors::CustomResult;
pub use diesel_models::process_tracker as storage;
use crate::{errors, SchedulerSessionState};
pub type WorkflowSelectorFn =
fn(&storage::ProcessTracker) -> Result<(), errors::Pr... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/drainer/src/stream.rs | crate: drainer
use redis_interface as redis;
use router_env::{logger, tracing};
use crate::{errors, metrics, Store};
pub type StreamEntries = Vec<(String, HashMap<String, String>)>;
pub type StreamReadResult = HashMap<String, StreamEntries>;
pub async f... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/drainer/src/stream.rs | crate: drainer
use redis_interface as redis;
use router_env::{logger, tracing};
use crate::{errors, metrics, Store};
pub type StreamEntries = Vec<(String, HashMap<String, String>)>;
pub type StreamReadResult = HashMap<String, StreamEntries>;
pub async f... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/drainer/src/stream.rs | crate: drainer
use redis_interface as redis;
use router_env::{logger, tracing};
pub type StreamEntries = Vec<(String, HashMap<String, String>)>;
pub type StreamReadResult = HashMap<String, StreamEntries>;
pub async fn is_stream_available(&self, stream_i... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/drainer/src/stream.rs | crate: drainer
use router_env::{logger, tracing};
use crate::{errors, metrics, Store};
pub type StreamEntries = Vec<(String, HashMap<String, String>)>;
pub type StreamReadResult = HashMap<String, StreamEntries>;
pub async fn read_from_stream(
&s... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/drainer/src/stream.rs | crate: drainer
use redis_interface as redis;
use router_env::{logger, tracing};
use crate::{errors, metrics, Store};
pub type StreamEntries = Vec<(String, HashMap<String, String>)>;
pub type StreamReadResult = HashMap<String, StreamEntries>;
pub async f... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/drainer/src/stream.rs | crate: drainer
use redis_interface as redis;
use router_env::{logger, tracing};
pub type StreamEntries = Vec<(String, HashMap<String, String>)>;
pub type StreamReadResult = HashMap<String, StreamEntries>;
pub async fn is_stream_available(&self, stream_i... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/drainer/src/stream.rs | crate: drainer
use crate::{errors, metrics, Store};
pub type StreamEntries = Vec<(String, HashMap<String, String>)>;
pub type StreamReadResult = HashMap<String, StreamEntries>;
pub(crate) fn get_drainer_stream_name(&self, stream_index: u8) -> String {
<... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/drainer/src/stream.rs | crate: drainer
use crate::{errors, metrics, Store};
pub type StreamEntries = Vec<(String, HashMap<String, String>)>;
pub type StreamReadResult = HashMap<String, StreamEntries>;
pub(crate) fn get_stream_key_flag(&self, stream_index: u8) -> String {
{<|fi... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/drainer/src/stream.rs | crate: drainer
pub type StreamEntries = Vec<(String, HashMap<String, String>)>;
pub type StreamReadResult = HashMap<String, StreamEntries>;
pub fn drainer_stream(&self, shard_key: &str) -> String {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/drainer/src/handler.rs | crate: drainer
use std::{
collections::HashMap,
sync::{atomic, Arc},
};
use crate::{
errors, instrument, logger, metrics, query::ExecuteQuery, tracing, utils, DrainerSettings,
Store, StreamData,
};
async fn drainer_handler(
store: A... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/drainer/src/handler.rs | crate: drainer
use tokio::{
sync::{mpsc, oneshot},
time::{self, Duration},
};
use crate::{
errors, instrument, logger, metrics, query::ExecuteQuery, tracing, utils, DrainerSettings,
Store, StreamData,
};
pub fn spawn_error_handlers(&sel... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/drainer/src/handler.rs | crate: drainer
use std::{
collections::HashMap,
sync::{atomic, Arc},
};
use tokio::{
sync::{mpsc, oneshot},
time::{self, Duration},
};
use crate::{
errors, instrument, logger, metrics, query::ExecuteQuery, tracing, utils, DrainerSet... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/drainer/src/handler.rs | crate: drainer
use tokio::{
sync::{mpsc, oneshot},
time::{self, Duration},
};
use crate::{
errors, instrument, logger, metrics, query::ExecuteQuery, tracing, utils, DrainerSettings,
Store, StreamData,
};
pub async fn redis_error_receive... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/drainer/src/handler.rs | crate: drainer
use tokio::{
sync::{mpsc, oneshot},
time::{self, Duration},
};
use crate::{
errors, instrument, logger, metrics, query::ExecuteQuery, tracing, utils, DrainerSettings,
Store, StreamData,
};
pub async fn redis_error_receive... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/drainer/src/handler.rs | crate: drainer
use std::{
collections::HashMap,
sync::{atomic, Arc},
};
use tokio::{
sync::{mpsc, oneshot},
time::{self, Duration},
};
use crate::{
errors, instrument, logger, metrics, query::ExecuteQuery, tracing, utils, DrainerSet... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/drainer/src/handler.rs | crate: drainer
use std::{
collections::HashMap,
sync::{atomic, Arc},
};
use tokio::{
sync::{mpsc, oneshot},
time::{self, Duration},
};
pub fn close(&self) {
{<|fim_suffix|>
<|fim_middle|>
}}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/drainer/src/handler.rs | crate: drainer
use std::{
collections::HashMap,
sync::{atomic, Arc},
};
use common_utils::id_type;
use tokio::{
sync::{mpsc, oneshot},
time::{self, Duration},
};
use crate::{
errors, instrument, logger, metrics, query::ExecuteQuery,... | ast_fragments |
// file: hyperswitch/crates/drainer/src/handler.rs | crate: drainer
use tokio::{
sync::{mpsc, oneshot},
time::{self, Duration},
};
fn deref(&self) -> &Self::Target {
&self.inner
} | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/drainer/src/handler.rs | crate: drainer
use std::{
collections::HashMap,
sync::{atomic, Arc},
};
use common_utils::id_type;
use router_env::tracing::Instrument;
use crate::{
errors, instrument, logger, metrics, query::ExecuteQuery, tracing, utils, DrainerSettings,
... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/drainer/src/query.rs | crate: drainer
use std::sync::Arc;
use common_utils::errors::CustomResult;
use diesel_models::errors::DatabaseError;
use crate::{kv, logger, metrics, pg_connection, services::Store};
async fn execute_query(
self,
store: &Arc<Store>,
... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/drainer/src/query.rs | crate: drainer
use common_utils::errors::CustomResult;
use crate::{kv, logger, metrics, pg_connection, services::Store};
fn push_drainer_delay(
pushed_at: i64,
operation: &str,
table: &str,
tags: &[router_env::opentelemetry::KeyValue],
) ... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/drainer/src/query.rs | crate: drainer
use std::sync::Arc;
use common_utils::errors::CustomResult;
use diesel_models::errors::DatabaseError;
use crate::{kv, logger, metrics, pg_connection, services::Store};
async fn execute_query(
self,
store: &Arc<Store>,
... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/drainer/src/query.rs | crate: drainer
use common_utils::errors::CustomResult;
use crate::{kv, logger, metrics, pg_connection, services::Store};
fn push_drainer_delay(
pushed_at: i64,
operation: &str,
table: &str,
tags: &[router_env::opentelemetry::KeyValue],
) ... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/drainer/src/main.rs | crate: drainer
use std::collections::HashMap;
use drainer::{errors::DrainerResult, logger, services, settings, start_drainer, start_web_server};
use router_env::tracing::Instrument;
async fn main() -> DrainerResult<()> {
<|fim_suffix|>
<|fim_middle|>
}
| ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/drainer/src/main.rs | crate: drainer
use std::collections::HashMap;
use drainer::{errors::DrainerResult, logger, services, settings, start_drainer, start_web_server};
use router_env::tracing::Instrument;
async fn main() -> DrainerResult<()> {
{// Get configuration<|fim_suffix|... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/drainer/src/health_check.rs | crate: drainer
use common_utils::{errors::CustomResult, id_type};
use error_stack::ResultExt;
use router_env::{instrument, logger, tracing};
use crate::{
connection::pg_connection,
errors::HealthCheckError,
services::{self, log_and_ret... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/drainer/src/health_check.rs | crate: drainer
use common_utils::{errors::CustomResult, id_type};
use diesel_models::{Config, ConfigNew};
use router_env::{instrument, logger, tracing};
use crate::{
connection::pg_connection,
errors::HealthCheckError,
services::{self,... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/drainer/src/health_check.rs | crate: drainer
use std::{collections::HashMap, sync::Arc};
use actix_web::{web, Scope};
use error_stack::ResultExt;
use router_env::{instrument, logger, tracing};
use crate::{
connection::pg_connection,
errors::HealthCheckError,
servic... | ast_fragments |
<|fim_prefix|>
// file: hyperswitch/crates/drainer/src/health_check.rs | crate: drainer
use std::{collections::HashMap, sync::Arc};
use actix_web::{web, Scope};
use router_env::{instrument, logger, tracing};
use crate::{
connection::pg_connection,
errors::HealthCheckError,
services::{self, log_and_return_er... | ast_fragments |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.