<div>I was accessing the Session model directly from within a worker and it was working:</div>
<div>&nbsp;</div>
<div>class ClearSessionsWorker &lt; BackgrounDRb::Rails<br>&nbsp; <br>&nbsp; repeat_every 7.minutes<br>&nbsp; first_run Time.now<br>&nbsp; <br>&nbsp; def do_work(args)<br>&nbsp;&nbsp;&nbsp; Session.destroy_all([&quot;updated_at &lt; ?&quot;, 20.minute.ago ])<br>
&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; ::BackgrounDRb::MiddleMan.instance.delete_worker @_job_key<br>&nbsp; end<br>end</div>
<div>&nbsp;</div>
<div>I just wasn't cleaning the workers up properly, but it was cleaning out sessions as it should...<br><br>&nbsp;</div>
<div><span class="gmail_quote">On 10/17/06, <b class="gmail_sendername">Bill Walton</b> &lt;<a href="mailto:bill.walton@charter.net">bill.walton@charter.net</a>&gt; 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>&gt; The session is not available in the workers.<br><br>Thanks for clearing that up for me!&nbsp;&nbsp;So the data 'inside' the session record
<br>is not available, but the session record IS?&nbsp;&nbsp;I'm using BackgroundRB to do<br>session cleanup for abandoned sessions.&nbsp;&nbsp;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 =&gt; [&quot;sessid = ?&quot;,<br>passed_in_session_id])<br>session_record.destroy<br><br>Is that right?&nbsp;&nbsp;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>