You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The async function is very slow with Q_CLUSTER['sync']=True if the sync=True parameter is not given to async.
I have some testcases in my own application:
class ApplicationTestCase(TestCase):
def test_async_slow(self):
from time import time
start = time()
self.assertEqual(settings.Q_CLUSTER['sync'], True)
for i in range(0, 5):
async('django.core.mail.send_mail',
subject = 'Invitation to join team {} at BuzzCo'.format('asd'),
from_email = settings.DEFAULT_FROM_EMAIL,
message = 'hi',
recipient_list = ['someone@corporate.com'],
fail_silently = False,
)
print(time() - start)
self.assertEqual(True, False) #fail to get output
def test_async_fast(self):
from time import time
start = time()
self.assertEqual(settings.Q_CLUSTER['sync'], True)
for i in range(0, 5):
async('django.core.mail.send_mail',
subject = 'Invitation to join team {} at BuzzCo'.format('asd'),
from_email = settings.DEFAULT_FROM_EMAIL,
message = 'hi',
recipient_list = ['someone@corporate.com'],
fail_silently = False,
async=True
)
print(time() - start)
self.assertEqual(True, False) #fail to get output
The
async
function is very slow with Q_CLUSTER['sync']=True if thesync=True
parameter is not given toasync
.I have some testcases in my own application:
outputs:
Notes:
The text was updated successfully, but these errors were encountered: