<div>I was accessing the Session model directly from within a worker and it was working:</div>
<div> </div>
<div>class ClearSessionsWorker < BackgrounDRb::Rails<br> <br> repeat_every 7.minutes<br> first_run Time.now<br> <br> def do_work(args)<br> Session.destroy_all(["updated_at < ?", 20.minute.ago ])<br>
<br> ::BackgrounDRb::MiddleMan.instance.delete_worker @_job_key<br> end<br>end</div>
<div> </div>
<div>I just wasn't cleaning the workers up properly, but it was cleaning out sessions as it should...<br><br> </div>
<div><span class="gmail_quote">On 10/17/06, <b class="gmail_sendername">Bill Walton</b> <<a href="mailto:bill.walton@charter.net">bill.walton@charter.net</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi Ezra,<br><br>Ezra Zygmuntowicz wrote:<br><br>> The session is not available in the workers.<br><br>Thanks for clearing that up for me! So the data 'inside' the session record
<br>is not available, but the session record IS? I'm using BackgroundRB to do<br>session cleanup for abandoned sessions. I'm thinking that I can pass the<br>session id to the worker and then, inside the worker, retrieve and delete
<br>that record with something like<br><br>session_record = Session.find(:first, :conditions => ["sessid = ?",<br>passed_in_session_id])<br>session_record.destroy<br><br>Is that right? Or do I need to do something special to access that record?
<br><br>Thanks,<br>Bill<br>_______________________________________________<br>Backgroundrb-devel mailing list<br><a href="mailto:Backgroundrb-devel@rubyforge.org">Backgroundrb-devel@rubyforge.org</a><br><a href="http://rubyforge.org/mailman/listinfo/backgroundrb-devel">
http://rubyforge.org/mailman/listinfo/backgroundrb-devel</a><br></blockquote></div><br>