Displaying 20 results from an estimated 800 matches similar to: "repeat_every doesn''t tie in with first_run..."
2006 Aug 29
1
Tasks get executed twice with repeat_every
I have a simple worker that I set up with repeat_every:
class DueNoteQueuerWorker < BackgrounDRb::Rails
repeat_every 1.minutes
first_run Time.now
def do_work(args)
@logger.debug("Sending due notes. The current time is #{Time.now}")
end
end
I want this to run every minute, all the time. The first run is fine,
but it seems that subsequent runs get executed
2006 Jul 13
4
Update
Folks-
I just commited another revision of the plugin. Nothing huge in this
update but some extra features. Acl lists are now configurable in the
config file. So you will want to blow away and recreate your config
file again. Thanks to Georg Friedrich for this.
And I applied Gunter Ladwig''s patch for singleton worker classes.
These are workers that only have one instance of
2006 Dec 13
4
Unintended thread forked in autostart
Hello all,
I''ve got the problem about the following simple application using
autostart and repeat_every.
A thread(?) is forked for processing task at first, but at sencond time
two threads seem to be forked.
My simple application code is...
- In worker class
class FooWorker < BackgrounDRb:Rails
repeat_every 2.minutes
first_run Time.now
def do_work
puts Time.now.to_s +
2006 Sep 25
1
Clearing ActiveRecord Sessions
Hello all,
I am interested in using BackgrounDRb to clear out ActiveRecord based
sessions. I have this working, just with a small hitch, here is the code:
class ClearSessionsWorker < BackgrounDRb::Rails
repeat_every 7.minutes
first_run Time.now
def do_work(args)
Session.destroy_all(["updated_at < ?", 20.minute.ago ])
end
end
It''s not very complicated and
2006 Sep 28
2
Duplicate record weirdness ?
First off BackgroundRb rocks!!!!. Top marks Ezra, it''s gone a long way to
stopping us from doing a nasty curl/cron hack :)
Okay so here''s what we''re using it for.
We''re synchronising data from a Filemaker database, via web service equest,
into a mysql database via a rails model called ''Syncer'' [How''s that for an
oddball use case!].
2006 Oct 04
0
first_run timezone weirdness
If you''re in a timezone with an abbreviation that map to more than one
timezone (eg, CST), first_run may not work as you expect it to.
Witness:
$ irb -r time
irb(main):001:0> Time.now
=> Wed Oct 04 20:37:24 CST 2006
irb(main):002:0> Time.parse(Time.now.to_s)
=> Thu Oct 05 10:37:30 CST 2006
Notice the 14 extra hours... Time.parse converted the time thinking
CST meant -06:00
2006 Sep 23
6
Connection to backgroundrb is lost when exiting action method
Hey.
I have a very annoying problem, and was wondering what is wrong.
Suppose I have backgroundrb running, and then I have an action in some
controller. In the action I define a worker. When leaving the action,
suddenly the connection to backgroundrb is lost:
DRb URI: druby://localhost:22222
Pid: 3976
Autostart...
done
druby://localhost:42531 - #<Errno::EBADF: Bad file descriptor -
2006 Aug 01
2
making backgroundrb cron
Hello,
i need to have some jobs scheduled in the background and executed at
specific times. I wanted to make a worker who does that - and it works a
little bit - but i had an enlightment... why not make bgdrb itself play that
role? i mean, the MiddleMan has already everything needed! a timer thread,
currently used only for deleting old workers and the workers itself. since
im not familiar with
2006 Aug 25
1
repeat_every when a worker is not done yet...
If I use repeat_every for a worker, if the do_work function has not
completed by the time the next interval rolls around, will a new
thread be started, resulting in 2 threads for the same worker?
Looking at start_process, it seems like the thread gets created (which
spins off the thread and then continues to execute the start_process
method, right?), then sets the @next_start. So if the
2006 Oct 16
6
accessing session data in worker
Is there something special I need to do to access session data in a worker?
I''m using an AR session store. I''ve been working with Ezra''s tutorial, modifying it a little here and there to figure it out. So I changed the progress bar to a simple count-down in the worker which sends back the count to display in the view. No big deal. But if I try to access session
2006 Oct 27
0
double runs from repeat_every
I''m just starting out with BackgrounDRB and I''m pretty excited. I know
there''s some development going on, but would patches against the
released code be welcome? Nothing profound, just some documentation errors.
Now for the real reason I''m writing. I''m testing the new(ish)
repeat_every code and it appears to be having a problem.
I''ve got a
2007 Mar 13
6
Easy Date question - newb
All I want to do is find the objects that were created today under the
''created_on'' column. I''ve tried many ways, here is one example using
the chronic gem.
@products = Product.find_all_by_created_on(Chronic.parse(''today''))
I must be missing something right in front of me .... Thanks for any
help.
2006 Oct 30
11
BackgrounDRb 0.2.0 Release! Complete rewrite.
Hello Folks-
I am really happy to announce the release of BackgrounDRb 0.2.0 .
This is a complete rewrite and re-architecture of this codebase. I
want to
thank skaar for all of his hard work. I put out a call for help with
the new
architecture and skaar stepped up bigtime. I had already written
the new
scheduler and cron compatible syntax and moved to multi process
architecture. But he
2006 Aug 23
5
Singleton-like Worker
Hello there,
I need a Worker Class to be Singleton-like, that means there must be at
maximum one Instance at a time. When a new Request is made to create another
worker of this type, it should return and wait for the other instance to be
destroyed.
what i need to do: i have a worker who needs to do sth with java and
openoffice, and it seems when i have more tha one worker simultaneously,
2006 Aug 16
6
Photo Albums?
Hello all,
Can anyone recommend any free(ish) Ruby photo album components?
Preferably something with a user structure built in.
Cheers.
--
Posted via http://www.ruby-forum.com/.
2006 Aug 07
8
Syntax Problem
In an *.rhtml, why do I need to add <% for product in @products %> in
order that I may call an <img class="list-image" src="<%=
product.img_url %>"/>. Is there not another way to skip the "for
product" line? I really dont want to include it. I tried @products =
product but it does not work. Can anyone help shed light on this matter?
--
Posted via
2006 Aug 01
2
actionmailer cant find template in backgroundrb
Im trying to send mails from a backgroundrb worker and it seems like
ActionView cant find my template. same code works as a rake task.
here my worker:
class StatusMailWorker < BackgrounDRb::Rails
repeat 1.minutes # <-- hehe!
def do_work(args)
[...blah...]
NotificationMailer.create_daily_report(users, rep, items)
end
end
end
its throwing the following error:
No
2007 Mar 04
2
BgDRb blocking in ActiveRecord
Hi Folks,
I''ve got a tiny little problem using MySQL-backed ActiveRecord in my
worker class. Sometimes it just blocks infinitely when I try to
access it. I don''t know whether it is in AR itself or in the SQL
driver. It just stops doing anything, logging nothing, no exceptions
are raised. I don''t know if it matters that I call the worker''s
methods via
2006 Aug 07
2
Process status...
I''ve used Railscron in a couple instances, and I liked that fact that
it has a rake task for checking the status of the process. Many times
I use it in the admin interface to allow me to double check that
everything is up and running.
I couldn''t find one for backgroundrb, so here is a simple one.
Probably obvious to everyone, and no doubt there is a better way to do
it:
2006 Aug 15
5
ActiveRecord inheritance
Hello,
I got the following issue and I do not know how to resolve it:
#1. created parent class (AccountExtended) for some my models
(lib/classes_lib.rb):
class AccountExtended < ActiveRecord::Base
def self.findByAccount
end
end
#2. created model Country:
require ''lib/classes_lib''
class Country < AccountExtended
end
#3. and added a test controller what shows