mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 06:27:58 +00:00
pallet-message-queue: add queue pausing (#14318)
* pallet-message-queue: add queue pausing Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Fix build Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Remove check Otherwise it would not start servicing queues that started paused and became unpaused afterwards. Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> --------- Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
committed by
GitHub
parent
2119c80225
commit
4249643df2
@@ -113,7 +113,7 @@ pub use preimages::{Bounded, BoundedInline, FetchResult, Hash, QueryPreimage, St
|
||||
mod messages;
|
||||
pub use messages::{
|
||||
EnqueueMessage, ExecuteOverweightError, Footprint, NoopServiceQueues, ProcessMessage,
|
||||
ProcessMessageError, ServiceQueues, TransformOrigin,
|
||||
ProcessMessageError, QueuePausedQuery, ServiceQueues, TransformOrigin,
|
||||
};
|
||||
|
||||
#[cfg(feature = "try-runtime")]
|
||||
|
||||
@@ -69,8 +69,18 @@ pub trait ProcessMessage {
|
||||
pub enum ExecuteOverweightError {
|
||||
/// The referenced message was not found.
|
||||
NotFound,
|
||||
/// The message was already processed.
|
||||
///
|
||||
/// This can be treated as success condition.
|
||||
AlreadyProcessed,
|
||||
/// The available weight was insufficient to execute the message.
|
||||
InsufficientWeight,
|
||||
/// The queue is paused and no message can be executed from it.
|
||||
///
|
||||
/// This can change at any time and may resolve in the future by re-trying.
|
||||
QueuePaused,
|
||||
/// An unspecified error.
|
||||
Other,
|
||||
}
|
||||
|
||||
/// Can service queues and execute overweight messages.
|
||||
@@ -220,3 +230,15 @@ where
|
||||
E::footprint(O::get())
|
||||
}
|
||||
}
|
||||
|
||||
/// Provides information on paused queues.
|
||||
pub trait QueuePausedQuery<Origin> {
|
||||
/// Whether this queue is paused.
|
||||
fn is_paused(origin: &Origin) -> bool;
|
||||
}
|
||||
|
||||
impl<Origin> QueuePausedQuery<Origin> for () {
|
||||
fn is_paused(_: &Origin) -> bool {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user