[libweb-mrest-perl] 02/16: script: store sessions in a dedicated directory in /tmp

Jonas Smedegaard dr at jones.dk
Wed Dec 6 01:59:41 UTC 2017


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag debian/0.288-1
in repository libweb-mrest-perl.

commit a9e76a77b66f592a7ea8b0ce06e6099fd6345d2c
Author: Nathan Cutler <ncutler at suse.com>
Date:   Sat Feb 25 04:23:33 2017 +0100

    script: store sessions in a dedicated directory in /tmp
    
    Signed-off-by: Nathan Cutler <ncutler at suse.com>
---
 bin/mrest | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/bin/mrest b/bin/mrest
index 03767ce..fbc390c 100644
--- a/bin/mrest
+++ b/bin/mrest
@@ -42,11 +42,13 @@ use warnings;
 use App::CELL qw( $log $site );
 use Web::MREST;
 use Data::Dumper;
+use File::Path qw( remove_tree );
 use Getopt::Long;
 use Log::Any::Adapter;
 use Module::Runtime qw( is_module_name require_module );
 use Plack::Builder;
 use Plack::Runner;
+use Plack::Session::Store::File;
 use Pod::Usage;
 use Try::Tiny;
 use Web::Machine;
@@ -228,6 +230,8 @@ _call_init( $app_module );
 my $app = _init_webmachine( $app_module );
 my $runner = Plack::Runner->new;
 $runner->parse_options(@ARGV);
+remove_tree('/tmp/mrest-sessions');
+mkdir '/tmp/mrest-sessions';
 
 $runner->run( 
     builder {
@@ -238,7 +242,10 @@ $runner->run(
             $log->$level( $message );
         };
 #        enable "StackTrace", force => 1;
-        enable "Session", store => 'File';
+#        enable "Session", store => 'File';
+        enable "Session", store => Plack::Session::Store::File->new(
+            dir => '/tmp/mrest-sessions'
+        );
         enable "Static", path => qr{/favicon}, root => $distro_sharedir;
         $app;
     }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libweb-mrest-perl.git



More information about the Pkg-perl-cvs-commits mailing list