This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defaults | |
mode http | |
timeout connect 5s | |
timeout client 30s | |
timeout server 30s | |
# Backend 1: Static IPs without health check | |
backend backend1 | |
balance roundrobin | |
server static1 10.0.0.1:80 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
worker_processes auto; | |
worker_rlimit_nofile 1024; | |
error_log logs/error.log debug; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
upstream seleniumhub { | |
server host1ip:4444; # replace this with actual upstream hub ip and port | |
server host2ip:4444; # replace this with actual upstream hub ip and port |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sendEmail(checkoutDetails) | |
if isCheckoutCompleted(checkoutDetails) | |
# send an email saying checkout is complete | |
else | |
# send an email saying checkout errored out | |
end | |
end | |
def isCheckoutCompleted(checkoutDetails) | |
if(checkoutDetails.length == 1) # same as no of rows |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sendEmail(numOfRows) | |
if(numOfRows == 1) | |
# send an email saying, checkout errored out | |
else | |
# send an email saying, checkout is complete | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class URLHelper | |
def getBaseUrl(usage) | |
if(usage == "option1") | |
return "https://www.samplevip.midwest.mycompany.com/option1prefix/defaultSuffix/SpecificValue" | |
else | |
return "https://www.samplevip.midwest.mycompany.com/defaultprefix/defaultSuffix/SpecificValue" | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class URLHelper | |
def initialize | |
@seperator = '/' | |
@domainSeperator = '.' | |
end | |
def getSchema() | |
"https" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function has_value (tab, val) | |
for index, value in ipairs (tab) do | |
if value == val then | |
return true | |
end | |
end | |
return false | |
end | |
REDIS_HOST = "127.0.0.1" | |
REDIS_PORT = "6379" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REDIS_HOST = "127.0.0.1" | |
REDIS_PORT = "6379" | |
DEFAULT_UPSTREAM_SERVER = "127.0.0.1" | |
local redis = require "resty.redis" | |
local red = redis:new() | |
red:set_timeout(1000) -- 1 second | |
local ok, err = red:connect(REDIS_HOST,REDIS_PORT) | |
if not ok then | |
ngx.var.target = DEFAULT_UPSTREAM_SERVER |