Revision 5da13d77

b/snf-cyclades-app/synnefo/logic/dispatcher.py
46 46
from synnefo import settings
47 47
setup_environ(settings)
48 48

  
49
from django.db import close_connection
50

  
49 51
import logging
50 52
import time
51 53

  
......
85 87
        log.info("Waiting for messages..")
86 88
        while True:
87 89
            try:
90
                # Close the Django DB connection before processing
91
                # every incoming message. This plays nicely with
92
                # DB connection pooling, if enabled and allows
93
                # the dispatcher to recover from broken connections
94
                # gracefully.
95
                close_connection()
88 96
                self.client.basic_wait()
89 97
            except SystemExit:
90 98
                break

Also available in: Unified diff