Mailinglist Archive: yast-devel (126 mails)

< Previous Next >
Re: [yast-devel] Re: [yast-commit] <rest-service> master : add Brute force protection
  • From: Martin Kudlvasr <mkudlvasr@xxxxxxx>
  • Date: Tue, 3 Nov 2009 10:38:57 +0100
  • Message-id: <200911031038.57957.mkudlvasr@xxxxxxx>
On Tuesday 03 November 2009 09:10:20 Josef Reidinger wrote:
Martin Kudlvasr write:

Maybe I misunderstood the code, but using Singleton module will not
preserve the instance between requests. Just try to create a simple
Singleton counter and view it a few times in some controller.
Singletons are regular instances of regular ruby class. The only
difference is, that you can make (new) only one of them. But they are
lost at the end of request like any other instance.
For storing values between requests AFAIK only database and module
namespace hacks work. I don't have anything against storing values in
module namespace, but I suggest doing it readable. For instance by
writing some "ModuleStorage" class/module whose only purpose would be to
store and retrieve values using module namespace.

Can you reproduce it? I am not able to do it. Also if singleton doesn't
preserve between request then something is very bad with ruby garbage
collector (if rails doesn't restart itself after each request), because
there exist reference to instance of class and it should not be destroyed.
What you maybe find is problem with class reloading in development mode

Aah, the development mode. That's where the problem lies. Thanks

To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >