gaiacoop / django-huey

A django integration for huey task queue that supports multi queue management
MIT License
67 stars 5 forks source link

Connection Failed. #21

Closed edmundrotimi closed 4 months ago

edmundrotimi commented 4 months ago

I keep getting "OperationalError connection failed: connection to server at "127.0.0.1", port 5432 failed: FATAL: password authentication failed for user "root" connection to server at "127.0.0.1", port 5432 failed: FATAL: password authentication failed for user "root". Strangely, I do not have a DB user 'root'. This does not happen in local development.

  @db_periodic_task(crontab(minute='*/1'), queue='application_expiration')
  def parcel_expiration_task():
      # current date and time
      current_timestamp = timezone.localtime(timezone.now())

      # get all event
      get_events = Event.objects.order_by('-creation_time').filter(
         time_ends__lt=current_timestamp
      )

      if get_events.exists():
          ....

I have tried to add a db. connection in the supervisor:

  [program: application]
  command='...'
  user='...'
  autostart=true
  autorestart=true
  redirect_stderr = true                                               
  stdout_logfile = '....'

I have also edited the pg_hba.conf file and add the following entry at the very end of the file:

  host    all             all              0.0.0.0/0                       md5
  host    all             all              ::/0                               md5