From: Marius Gavrilescu Date: Wed, 29 Jan 2014 23:14:26 +0000 (+0200) Subject: Add database support for problem opening X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=0b282e58119cc0dbce678ef56eab20cc352557b5;p=plack-app-gruntmaster.git Add database support for problem opening --- diff --git a/lib/Gruntmaster/Data.pm b/lib/Gruntmaster/Data.pm index eaa96c5..1b2492c 100644 --- a/lib/Gruntmaster/Data.pm +++ b/lib/Gruntmaster/Data.pm @@ -84,6 +84,16 @@ sub clean_job (_){ HDEL cp . "job.$_[0]", qw/result result_text results daemon/ } +sub mark_open { + my ($problem, $user) = @_; + HSETNX cp . 'open', "$problem.$user", time; +} + +sub get_open { + my ($problem, $user) = @_; + HGET cp . 'open', "$problem.$user"; +} + our @EXPORT = do { no strict 'refs'; grep { $_ =~ /^[a-zA-Z]/ and exists &$_ } keys %{__PACKAGE__ . '::'};