edu
edu

Reputation: 1

Task queues with Flask - Redis server quitting before executing

I'm tryng to set up a redis server in order to run a simple task through RQ

I start a RQ worker from the VSC terminal, then open a new terminal, kick in a py shell session and type the following:

>>> from redis import Redis
>>> import rq
>>> queue = rq.Queue('microblog-tasks', connection=Redis.from_url('redis://'))
>>> job = queue.enqueue('app.tasks.example', 23)
>>> job.get_id()

before I end typing the last command, the first terminal with the rq worker has already raised an unhandled exception and quits. the attribute error is "module os has no attribute 'fork'" I see that this is a UNIX thing, but I did set up a redis server through the WSL bash. I would appreciatte any help into figuring out what is happening. thanks!

i think so. this is the output to systemctl status redis on the bash:

 - ● redis-server.service - Advanced key-value store
        Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled)
        Active: active (running) since Wed 2024-02-21 16:04:31 -03; 2h 18min ago
          Docs: http://redis.io/documentation,
                man:redis-server(1)    Main PID: 213 (redis-server)
        Status: "Ready to accept connections"
         Tasks: 5 (limit: 4584)
        Memory: 16.1M
        CGroup: /system.slice/redis-server.service
                └─213 "/usr/bin/redis-server 127.0.0.1:6379" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ">
   
   Feb 21 16:04:31 Kaneda systemd[1]: Starting Advanced key-value
   store... Feb 21 16:04:31 Kaneda systemd[1]: Started Advanced
   key-value store.

Upvotes: 0

Views: 71

Answers (0)

Related Questions