Guest User

Untitled

a guest
Nov 23rd, 2018
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. default: &default
  2. adapter: postgresql
  3. host: localhost
  4. pool: 5
  5. encoding: utf8
  6. timeout: 5000
  7. username: username
  8. password: password
  9.  
  10. development:
  11. <<: *default
  12. database: development
  13. password: password
  14.  
  15. test:
  16. <<: *default
  17. database: test
  18.  
  19. production:
  20. <<: *default
  21. database: production
  22. password: password
  23.  
  24. namespace :user do
  25. desc "TODO"
  26. task update_subscription: :environment do
  27. puts "--- Starting user subscription check at #{DateTime.now} ---"
  28. User.find_each do | user |
  29. if user.refresh_date.past?
  30. user.refresh_date = Date.today + 1.month
  31. puts "User #{user.id} subscription updated"
  32. end
  33. end
  34. end
  35. end
  36.  
  37. every 1.day, :at => '00:01 am' do
  38. rake "user:update_subscription"
  39. end
  40.  
  41. 1 0 * * * /bin/bash -l -c 'cd /home/app/app && RAILS_ENV=production bundle exec rake user:update_subscription --silent >> log/cron_log.log 2>&1'
  42.  
  43. local all postgres peer
  44.  
  45. # TYPE DATABASE USER ADDRESS METHOD
  46.  
  47. # "local" is for Unix domain socket connections only
  48. local all all peer
  49. # IPv4 local connections:
  50. host all all 127.0.0.1/32 md5
  51. # IPv6 local connections:
  52. host all all ::1/128 md5
  53. # Allow replication connections from localhost, by a user with the
  54. # replication privilege.
  55. #local replication postgres peer
  56. #host replication postgres 127.0.0.1/32 md5
  57. #host replication postgres ::1/128 md5
  58.  
  59. --- Starting user subscription check at 2018-11-23T10:20:05+00:00 ---
  60. rake aborted!
  61. PG::ConnectionBad: fe_sendauth: no password supplied
  62. /home/app/app/lib/tasks/script.rake:5:in `block (2
  63. levels) in <top (required)>'
  64. /home/app/.rbenv/versions/2.3.8/bin/bundle:22:in `load'
  65. /home/app/.rbenv/versions/2.3.8/bin/bundle:22:in `<main>'
  66. Tasks: TOP => user:update_subscription
  67. (See full trace by running task with --trace)
Add Comment
Please, Sign In to add comment