S
S
Space2018-05-02 12:54:59
PHP
Space, 2018-05-02 12:54:59

How to close mysql connection in a looped script?

I am using RabbitMQ. It has workers where there are different queries to the database. And I have connections to the database, tk. they are not closed (the script does not end, but waits for new messages).
Question: what are the correct ways to close the connection?
I see:
1. Or manually register closing the connection after saving the message.
2. Or do not close (but it eats a lot of resources)
3. Or there is something else.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2018-05-02
@Sanasol

So maybe you don’t need to open a connection every time you receive a task, then they won’t accumulate?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question