Skip to content

Commit

Permalink
'watch folder script and database timeout updates'
Browse files Browse the repository at this point in the history
  • Loading branch information
foglabs committed Jun 13, 2024
1 parent b97d55b commit 07a6fc2
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/jobs/mars_ingest_item_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def update_status(status, error_msg='')

def ingest_payload(payload)
logger.info "Trying to Ingest Payload"
host = Rails.env.development? ? 'mlavalon_avalon_1:3000' : '127.0.0.1:80'
host = Rails.env.development? ? 'mlavalon_avalon_1:3000' : 'localhost:3000'

params = {
method: :post,
Expand Down
3 changes: 2 additions & 1 deletion config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ production:
database: avalon
pool: 5
username: postgres
# password:
variables:
statement_timeout: 30000
32 changes: 25 additions & 7 deletions script/watch_folder.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,34 @@
#!/bin/bash

# get em
all=$(cat /proc/1/environ)
# split em
vars=$(echo $all | tr "\0" "\n")
for var in $vars
# all=$(cat /proc/1/environ)
all=$(xargs -0 -L1 -a /proc/1/environ)

# loop through, bash auto splits on whitespace ooh ooh
for var in $all
do
# export em
piece1 = $(echo $var | tr "=", "\n")[0]
piece2 = $(echo $var | tr "=", "\n")[1]
export `${piece1}=${piece2}`

piece2=${var#*=}
piece1=${var%"$piece2"}

# counter=0
# pieces=$(echo $var | tr "=", "\n")
# for piece in $pieces
# do
# if ((counter == 0));
# then
# piece1=$piece
# else
# piece2=$piece
# fi
# counter=${counter}+1
# done

eval 'export $piece1"${piece2//-D/\\\-D}"'
# eval 'export $piece1"$piece2"'
done

# ooh ah so nice

bundle exec ruby script/watch_folder.rb

0 comments on commit 07a6fc2

Please sign in to comment.