Last change
on this file since 861 was
861,
checked in by nanardon, 13 years ago
|
- reimport missing files from previous svn
|
File size:
756 bytes
|
Rev | Line | |
---|
[861] | 1 | package LATMOS::Accounts::Task; |
---|
| 2 | |
---|
| 3 | use strict; |
---|
| 4 | use warnings; |
---|
| 5 | use LATMOS::Accounts::Log; |
---|
| 6 | |
---|
| 7 | sub new { |
---|
| 8 | my ($class, $module, %options) = @_; |
---|
| 9 | my $pclass = ucfirst(lc($module)); |
---|
| 10 | my $me = __PACKAGE__; |
---|
| 11 | eval "require ${me}::$pclass;"; |
---|
| 12 | if ($@) { return } # error message ? |
---|
| 13 | return "${me}::$pclass"->_new(%options); |
---|
| 14 | } |
---|
| 15 | |
---|
| 16 | sub _new { |
---|
| 17 | my ($class, %options) = @_; |
---|
| 18 | bless { %options }, $class; |
---|
| 19 | } |
---|
| 20 | |
---|
| 21 | sub init { |
---|
| 22 | return 1; |
---|
| 23 | } |
---|
| 24 | |
---|
| 25 | sub needupd { |
---|
| 26 | my ($self, $baserev, $syncm) = @_; |
---|
| 27 | |
---|
| 28 | la_log LA_DEBUG, "Comparing db: %d <=> %d", $syncm->dbrev, $baserev; |
---|
| 29 | if ($syncm->dbrev > $baserev) { |
---|
| 30 | return 1; |
---|
| 31 | } else { |
---|
| 32 | la_log LA_DEBUG, "No change in DB, doing nothing"; |
---|
| 33 | return; |
---|
| 34 | } |
---|
| 35 | } |
---|
| 36 | |
---|
| 37 | sub run { |
---|
| 38 | return 1; |
---|
| 39 | } |
---|
| 40 | |
---|
| 41 | sub post { |
---|
| 42 | } |
---|
| 43 | |
---|
| 44 | 1; |
---|
Note: See
TracBrowser
for help on using the repository browser.