Sha256: 7681471b61ff83e44f09f7c84317113fce063adbf393cc04f4dc741f6e10fdab

Contents?: true

Size: 755 Bytes

Versions: 10

Compression:

Stored size: 755 Bytes

Contents

require 'flydata/helper/action/agent_action'

module Flydata
  module Helper
    module Action
      class Flush <  AgentAction
        def command(opts = {})
          "sync:flush -y %s" % [build_options(opts)]
        end

        def build_options(opts)
          opt_str = ""

          if config_hash(opts)[:skip_flush] # skip server flush
            opt_str << " --skip-flush"
          end

          timeout = config_hash(opts)[:server_timeout].to_i
          if timeout > 0 && timeout <= 3600 # max 1 hour
            opt_str << " --server-timeout #{timeout}"
          end

          if !!config_hash(opts)[:dont_wait_upload]
            opt_str << " --dont-wait-upload"
          end

          opt_str
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
flydata-0.8.10.2 lib/flydata/helper/action/flush.rb
flydata-0.8.10.1 lib/flydata/helper/action/flush.rb
flydata-0.8.9.11 lib/flydata/helper/action/flush.rb
flydata-0.8.10 lib/flydata/helper/action/flush.rb
flydata-0.8.9 lib/flydata/helper/action/flush.rb
flydata-0.8.8 lib/flydata/helper/action/flush.rb
flydata-0.8.7 lib/flydata/helper/action/flush.rb
flydata-0.8.6 lib/flydata/helper/action/flush.rb
flydata-0.8.5 lib/flydata/helper/action/flush.rb
flydata-0.8.4 lib/flydata/helper/action/flush.rb