From 0b282e58119cc0dbce678ef56eab20cc352557b5 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Thu, 30 Jan 2014 01:14:26 +0200 Subject: [PATCH] Add database support for problem opening --- lib/Gruntmaster/Data.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) 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__ . '::'}; -- 2.39.2