#------------------------------------------------------------
# Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved
# $Id$
#------------------------------------------------------------
package RPS::LabelRoyalty::Job::CommitLabelRoyaltyRun;

use strict;
use warnings;
use Sys::Hostname;

use lib '/app/tools/common/lib';
use Common::Log; 
use Common::Assert;
use Common::RSApp;

use lib '/app/tools/rps/lib';
use RPS::Config;

use lib '/app/tools/job/lib';
use Job::Job;

use base 'Job::Job';

use constant kJobClass => 'CommitLabelRoyaltyRun';

sub _generateCommandLine
{
    my ($self) = @_;

    my $runID = $self->getCommandLineArg('runID');
    assert($runID);

    my $clientID = $self->clientID();

    my $logLevel = $self->getCommandLineArg('logLevel');
    $logLevel = 2 unless $logLevel;

    my $config = RPS::Config->new();
    my $scriptPath = $config->get('royalty_script_dir');

    my $commandLine = "nice $scriptPath/commit_label_royalty_run.pl -c $clientID -r $runID -V $logLevel";

    return $commandLine;
}

sub _defaultClass       { return 'RunUtility'; }
sub _defaultSubclass    { return 'CommitLabelRoyaltyRun'; }
sub _defaultPriority    { return Job::Job::kPriorityHigh; }

###
1;#
###

