clockwork_crank/instructions/
queue_resume.rs1use {
2 crate::state::*,
3 anchor_lang::prelude::*,
4};
5
6#[derive(Accounts)]
7pub struct QueueResume<'info> {
8 #[account()]
9 pub authority: Signer<'info>,
10
11 #[account(
12 mut,
13 seeds = [
14 SEED_QUEUE,
15 queue.authority.key().as_ref(),
16 queue.id.as_bytes(),
17 ],
18 bump,
19 has_one = authority
20 )]
21 pub queue: Account<'info, Queue>,
22}
23
24pub fn handler(ctx: Context<QueueResume>) -> Result<()> {
25 let queue = &mut ctx.accounts.queue;
27
28 queue.is_paused = false;
30
31 match queue.exec_context {
33 None => {}
34 Some(exec_context) => {
35 match exec_context {
36 ExecContext::Cron { started_at: _ } => {
37 queue.exec_context = Some(ExecContext::Cron { started_at: Clock::get().unwrap().unix_timestamp });
39 }
40 ExecContext::Immediate => {
41 }
43 }
44 }
45 }
46
47 Ok(())
48}