[freeside-users] freeside-daily question

Gerald Livingston gerald.freeside at sysmatrix.net
Mon May 31 23:23:36 PDT 2010


On Mon, 24 May 2010 10:19:07 -0700
Ivan Kohler <ivan at freeside.biz> wrote:

> On Tue, Apr 27, 2010 at 07:57:54PM -0500, Gerald Livingston wrote:
> > Freeside 1.5.8 running on Debian Linux
> 
> Upgrade.  1.5.8 is four years old and is no longer maintained or 
> supported at all.  1.7 is maintenance-only for specific embedded 
> customers at this point.  1.9 is recommended.

I know that. I'm a one-man shop and have been planning an upgrade for
at least 18 months. Gotta find the time.

> > I run freeside-daily just after midnight like this from crontab:
> > 
> > 05 0 * * *  freeside /usr/local/bin/freeside-daily -d 23:59:59 user
> > 
> > The -d 23:59:59 is because I discovered (long ago) some accounts
> > have a billing time other than 00:00:00 (it appears to be from an
> > old import) and they were getting missed completely because their
> > billing time hadn't passed on the day it was run (at midnight) and
> > on the following day it skipped them because they were set to be
> > billed "yesterday".
> 
> No, that is incorrect.  freeside-daily will bill everyone with a next 
> bill date of now or in the past.  It won't skip people set to be 
> re-billed "yesterday" or at any day in the past.  A quick perusal of
> the code shows this seems to be the case back to at least 1.4.

Please note, the above does *not* state that it failed to bill
accounts with a next bill date *in the past*. It fails to bill those
with a next bill date *in the FUTURE* but still "today". I shouldn't
have said "missed completely".

For example: An account is imported from a .csv rather than being
created through FreeSide. The next bill date is set to tomorrow but the
TIME is set to the time it was imported 

(eg. Next Bill Date: 06/01/2010 18:53:42)

If I run freeside-daily 06/01/2010 00:00:01 then the account mentioned
above will NOT get billed. When I run freeside-daily again at
06/02/2010 00:00:01 then that account might be billed but I never
checked because any account like that would essentially be getting
billed a day late EVERY month. 

If I make sure billing thinks it's running at 23:59:59 on the day of
billing then everything with a billing date of that day is guaranteed
to have a billing TIME earlier than the run.

> > Now, my first-of-month billing has gotten large enough that it is no
> > longer completing before my credit card processor does its daily
> > settle so I want to start the billing BEFORE midnight each day and
> > I'm wondering how freeside-daily batches/forks the command
> > processes.
> 
> Without the -m flag, it doesn't.  With the -m flag, all daily billing
> is run through the job queue.  This can offer a sigificant speedup, 
> especially for those cases where freeside-daily spends most of its
> time waiting for responses from the credit card gateway.

Looking through changelogs "-m" appears to have been put in 1.9.x about
2 years ago and only ported to 1.7.x a little over a year ago. Long
after you stopped updating 1.5.x.  I have no -m flag so I'll run slow
until I upgrade.

http://cvs.420.am/cgi-bin/viewvc.cgi/freeside/FS/FS/Cron/bill.pm?revision=1.9&view=markup&sortby=author

http://cvs.420.am/cgi-bin/viewvc.cgi/freeside/FS/FS/Cron/bill.pm?revision=1.2.2.5&view=markup&sortby=author

> Also worth noting is that -d (or the time freeside-daily starts) is
> used for all billing jobs, no matter how long the process takes.

This is what I was looking for and my runs starting at 23:00 do indeed
carry across the midnight boundary just fine.

thank you,

Gerald

-- 
I am on the email list. Unless you are sending information which should
not be shared with everyone else please reply to the list, not directly
to me.


More information about the freeside-users mailing list