Module: RubyGaurden::Execution

Extended by:
ActiveSupport::Concern
Included in:
Bed
Defined in:
lib/ruby_gaurden/execution.rb

Constant Summary collapse

DEFAULT_MAXIMUM_EXECUTION_TIME =
1000
DEFAULT_MAX_MEMORY =

512MB default limit

512 * 1024 * 1024

Instance Method Summary collapse

Instance Method Details

#contextObject



79
80
81
# File 'lib/ruby_gaurden/execution.rb', line 79

def context
  @context ||= checkout_context
end

#maximum_execution_timeObject



65
66
67
# File 'lib/ruby_gaurden/execution.rb', line 65

def maximum_execution_time
  @maximum_execution_time ||= self.class.maximum_execution_time
end

#maximum_execution_time_msObject



73
74
75
76
77
# File 'lib/ruby_gaurden/execution.rb', line 73

def maximum_execution_time_ms
  return unless maximum_execution_time

  maximum_execution_time * 1000
end

#maximum_memoryObject



69
70
71
# File 'lib/ruby_gaurden/execution.rb', line 69

def maximum_memory
  @maximum_memory ||= self.class.maximum_memory
end