Skip to content

Stand-alone processes #13

Description

@leandrosardi

Descriptor

BlackStack::Pampa::add_proc(
        {
            # name must be unique
            # name cannot have spaces
            :name => 'leads.export',
            # node where this process will run
            :node => :n01,
            # location of the `proc.rb` file
            :working_directory => '/root/code/mysaas/p',
            # where to write the log
            :logfile => '/home/ubuntu/code/mysaas/export.log',
            # simple_command_line_parser descriptor
            # reference: https://github.com/leandrosardi/simple_command_line_parser
            :params => [
                { :name=>'foo', :value=>'bar' },
                { :name=>'foo2', :value=>'bar2'},
            ],
            # setup a minimum delay between cycles, in order to avoid database overworking.
            :min_cycle_seconds => 60,
            # script to run
            :processing_function => Proc.new do |*args|
                # TODO: Code Me!
            end,
        }
)

Process Running

BlackStack::Pampa.get_proc_command(:'leads.export')
=> "cd ~ & nohup ruby ~/code/mysaas/p/proc.rb name=leads.export foo=bar foo2=bar2 >/dev/null 2>&1 &"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions