Topic: New notifications
kaputtnik Topic Opener |
Posted at: 2017-05-09, 22:01
Hi all, I did some updates to the website. For the users the most interesting changes are:
Sending emails is deferred, there is a delay of max. 20 Minutes until you will receive the notifications for
Hopefully all works fine, sincerely (Post it as topic to test the speedup of creating topics ) Edited: 2017-05-09, 22:03
Top Quote |
GunChleoc |
Posted at: 2017-05-09, 22:13
Faster topic creation is indeed a great feature P.S.: submitting posts is also faster now! Edited: 2017-05-09, 22:13
Busy indexing nil values Top Quote |
SirVer |
Posted at: 2017-05-10, 05:54
Speed is a feature that most people do not mention, but that sub-concisely affects satisfaction with a product significantly. Great work, kaputtnik, you are truly a hero of the people!! Top Quote |
king_of_nowhere |
Posted at: 2017-05-12, 01:13
topic creation was already very fast, i don't see the difference. improved notifications are welcome Top Quote |
kaputtnik Topic Opener |
Posted at: 2017-05-12, 08:21
Yes, the creation is fast, but the response took a very long time. There where some users who created two identical topics, because after clicking 'send' the users Browser-tab does not update (the tab indicates 'working') and they assume something has gone wrong. The problem on server side was that after clicking 'send' the new topic was saved very fast, but the server did not send the response back to the user immediately. The response was only send until all 'new topic subscribers' get emailed. So the more 'new topic subscribers' there are, the longer took the response and the browsers tab indicates 'working' for the user who creates the new topic.
I am working on some more notifications (e.g. map comments, new news), but this isn't trivial Top Quote |
einstein13 |
Posted at: 2017-05-12, 19:55
So how did you solve this? By threading? Or something else? einstein13 |
GunChleoc |
Posted at: 2017-05-12, 20:03
He shoved all the e-mails into a queue that will be taken care of by a chron job every 20 minutes All the gory details can be read here. Edited: 2017-05-12, 20:04
Busy indexing nil values Top Quote |
kaputtnik Topic Opener |
Posted at: 2017-05-12, 21:03
To be honest i didn't solved it really, just used the code that was initially there. Emails are queued as pickled objects in a database table. A cron job runs every 20 minutes to unpickle the data and send the emails. Threading was also an idea, but since the implemented solution works, i didn't look into it much. Top Quote |
einstein13 |
Posted at: 2017-05-12, 21:27
Nice idea! I would bring celery task queued. It is working faster (a few seconds), but probably it needs more configuration I guess that cron is included to some linux distributions as default? Great work, Kaputtnik! einstein13 |
kaputtnik Topic Opener |
Posted at: 2017-05-22, 21:49
Sorry overlooked your post
Yes, celery seems to be the thing for threading. But it brings also another third party dependency to the website. With every third party dependency there is more work for maintenance.
Yes, cron is default in every linux distribution (as far as i know).
Thanks Top Quote |