Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the MojoX-Redis CPAN distribution.

Report information
The Basics
Id: 69919
Status: resolved
Priority: 0/
Queue: MojoX-Redis

People
Owner: Nobody in particular
Requestors: growantr [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: problem with hget (hmget) and stash
When running this code several times "stash(text3)" first time appearing normal. Then value of all fields (test1, test2, test3) changed. Value of text1 and text2 changing normal. Value of stash(text3) will change only after reloading the page (F5 or Ctrl-R). The same problem when I try to get value of test1, test2, test3 from hget('111', test1); my $redis = MojoX::Redis->new(server => '127.0.0.1:6379'); $redis = $redis->ioloop(Mojo::IOLoop->new); $redis->hmget('111', 'test1', 'test2' , 'test3' => sub { my ($redis, $res) = @_; $data_out1 = $res->[0]; $data_out2 = $res->[1]; $data_out3 = $res->[2]; print $data_out3->[0]; #for check up that it's not Mojolicious fault $redis->stop; }); $redis->start; $self->stash(text1 => $data_out1->[0]); $self->stash(text2 => $data_out2->[0]); $self->stash(text3 => $data_out3->[0]); $redis->quit; So I suggest is it problem of MojoX::Redis. Sorry for poor English. Let me know if you have any misunderstanding (объясню по-русски). #uname -a Linux 2.6.33 i686 zenwalk.org #perl -v 5.10.1 #mojolicious version 1.64 (running as daemon) #mojox::redis version 0.81 #redis version 2.2.12 #browsers version opera 10.60 icecat 3.6.3
Вск Июл 31 12:37:21 2011, i_eremin писал: Show quoted text
> When running this code several times "stash(text3)" first time > appearing normal. > Then value of all fields (test1, test2, test3) changed. Value of text1 > and text2 > changing normal. Value of stash(text3) will change only after > reloading the page > (F5 or Ctrl-R). The same problem when I try to get value of test1, > test2, test3 from > hget('111', test1); > > my $redis = MojoX::Redis->new(server => '127.0.0.1:6379'); > $redis = $redis->ioloop(Mojo::IOLoop->new); > > $redis->hmget('111', 'test1', 'test2' , 'test3' => sub { > my ($redis, $res) = @_; > $data_out1 = $res->[0]; > $data_out2 = $res->[1]; > $data_out3 = $res->[2]; > print $data_out3->[0]; #for check up that it's not Mojolicious fault > $redis->stop; > }); > > $redis->start; > $self->stash(text1 => $data_out1->[0]); > $self->stash(text2 => $data_out2->[0]); > $self->stash(text3 => $data_out3->[0]); > $redis->quit; > > So I suggest is it problem of MojoX::Redis. Sorry for poor English. > Let me know if > you have any misunderstanding (объясню по-русски). > > #uname -a > Linux 2.6.33 i686 zenwalk.org > #perl -v > 5.10.1 > #mojolicious version > 1.64 (running as daemon) > #mojox::redis version > 0.81 > #redis version > 2.2.12 > #browsers version > opera 10.60 > icecat 3.6.3
I can't reproduce your problem. This code works like a charm https://gist.github.com/1117988 Please use request tracker of github https://github.com/und3f/mojox-redis/issues
Вск Июл 31 12:37:21 2011, i_eremin писал: Show quoted text
> When running this code several times "stash(text3)" first time > appearing normal. > Then value of all fields (test1, test2, test3) changed. Value of text1 > and text2 > changing normal. Value of stash(text3) will change only after > reloading the page > (F5 or Ctrl-R). The same problem when I try to get value of test1, > test2, test3 from > hget('111', test1); > > my $redis = MojoX::Redis->new(server => '127.0.0.1:6379'); > $redis = $redis->ioloop(Mojo::IOLoop->new); > > $redis->hmget('111', 'test1', 'test2' , 'test3' => sub { > my ($redis, $res) = @_; > $data_out1 = $res->[0]; > $data_out2 = $res->[1]; > $data_out3 = $res->[2]; > print $data_out3->[0]; #for check up that it's not Mojolicious fault > $redis->stop; > }); > > $redis->start; > $self->stash(text1 => $data_out1->[0]); > $self->stash(text2 => $data_out2->[0]); > $self->stash(text3 => $data_out3->[0]); > $redis->quit; > > So I suggest is it problem of MojoX::Redis. Sorry for poor English. > Let me know if > you have any misunderstanding (объясню по-русски). > > #uname -a > Linux 2.6.33 i686 zenwalk.org > #perl -v > 5.10.1 > #mojolicious version > 1.64 (running as daemon) > #mojox::redis version > 0.81 > #redis version > 2.2.12 > #browsers version > opera 10.60 > icecat 3.6.3
Also i didn't get any problems with this mojo lite app https://gist.github.com/1117999 (when i changed the fields of hash with redis-cli)
From: growantr [...] gmail.com
Sorry for poor description. Please try code in merged file. The problem is: I have 4 steps application. In first three steps I choose a value ("one" or "two" or "three"). In each step chosen value loading into Redis. In fourth step all chosen values are grabbed from Redis and displayed in browser. First time I chose "one-one-one". In browser I see "one-one-one". Next time I have chosen "two-two-two" but in browser I have seen "two-two-one". Press F5 button and I see "two-two-two". Third time I have chosen "three-three-three" but in fourth step I have seen "three- three-two". Press F5 and I see "three-three-three". Etc. About github. I Never use it. So I don't know what to do.
Subject: mojox_redis_tests.tar.gz
Download mojox_redis_tests.tar.gz
application/x-gzip 3.2k

Message body not shown because it is not plain text.

Please don't send such complicated tests with a bug inside. If you need help with debugging you can ask for a help on IRC irc.perl.org #perl-help and #ru.pm (last one is russian). You can learn about github and how to use it on github.com Here is how to fix your buggy app: --- ./lib/My_App/Tests.pm.orig 2011-08-01 16:52:31.000000000 +0300 +++ ./lib/My_App/Tests.pm 2011-08-01 19:02:45.110000001 +0300 @@ -52,9 +52,9 @@ my $self = shift; - my $redis = MojoX::Redis->new(server => '127.0.0.1:6379', encoding=>'UTF-8'); - $redis->hset('111', 'third', $self->param('third')); - $redis->quit; + my $redis = MojoX::Redis->new(server => '127.0.0.1:6379', encoding=>'UTF-8', ioloop => Mojo::IOLoop->new); + $redis->hset('111', 'third', $self->param('third'), sub {$redis->quit; $redis->stop}); + $redis->start; $self->redirect_to('http://127.0.0.1:3000/report'); }