Skip to content

Instantly share code, notes, and snippets.

@jberger
Last active December 9, 2019 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jberger/a2e18ba51ebee6f8cff99409bc8ebf33 to your computer and use it in GitHub Desktop.
Save jberger/a2e18ba51ebee6f8cff99409bc8ebf33 to your computer and use it in GitHub Desktop.
my ($time, $ticket_ids) = await Mojo::Promise->all(
$redis->get_p("department:$id:tickets:refresh"),
$redis->smembers_p("department:$id:tickets"),
);
return [] unless @{ $ticket_ids->[0] };
my @tickets = await Mojo::Promise->all(map { $self->get($_) } @{ $ticket_ids->[0] });
return (
[map { $_->[0] } @tickets],
$time->[0],
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment