#!/usr/bin/perl -w

package RDAS::Throttler::Daemon;

use lib '/app/tools/rdas/lib';
use RDAS::Throttler;
use RDAS::Throttler::Host;

use lib '/app/tools/common/lib';
use base 'Common::Daemon';

sub logfile   { Common::RSApp::GetConfig( 'rdas', 'throttler_log' ) }
sub pidfile   { Common::RSApp::GetConfig( 'rdas', 'throttler_pid_file' ) }
sub sleepTime { Common::RSApp::GetConfig( 'rdas', 'throttler_sleep_time' ) }

sub _heartbeat {
    my $self = shift;
    my $host = new RDAS::Throttler::Host;

    Log->notice("Updating heartbeat for host: $host->{Hostname}");
    $host->updateHeartbeat();
}

sub _process {
    my $throttler = new RDAS::Throttler;
    $throttler->run();
}

1;
