ops-trust / portal

Ops-Trust Platform - Portal
https://www.ops-trust.net
Apache License 2.0
21 stars 4 forks source link

Fix cronrun-day and portal_query #52

Closed teward closed 9 years ago

teward commented 9 years ago

There's a few reasons for these changes being required.

  1. The portal_query function as it was written would never have pulled in arguments form elsewhere.
  2. The portal_query function, even if arguments are passed in, would never receive single-quote items (such as used with -c 'SELECT ... as it was in the cronrun-day script). Bash string handling happens before it gets ingested into arguments, which makes the use of this as a function irrelevant.
  3. Changing portal_query to a variable with the query string stored in it, and then calling it as a variable elsewhere, solves the issue of the queries hanging or failing.

Without such changes, the daily run cron script will fail to finish executing and fail to do what it is supposed to do.