Mercurial > public > sg101
comparison core/tasks.py @ 681:53a56d19568c
For Django 1.5.2; cleanup command is now called clearsessions.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Fri, 16 Aug 2013 20:43:39 -0500 |
parents | ee87ea74d46b |
children | aeafbf3ecebf |
comparison
equal
deleted
inserted
replaced
680:91de9b15b410 | 681:53a56d19568c |
---|---|
35 """ | 35 """ |
36 # These imports, when placed at the top of the module, caused all kinds of | 36 # These imports, when placed at the top of the module, caused all kinds of |
37 # import problems when running on the production server (Python 2.5 and | 37 # import problems when running on the production server (Python 2.5 and |
38 # mod_wsgi). Moving them here worked around that problem. | 38 # mod_wsgi). Moving them here worked around that problem. |
39 | 39 |
40 from django.core.management.commands.cleanup import Command as CleanupCommand | 40 from django.contrib.sessions.management.commands import clearsessions |
41 from forums.management.commands.forum_cleanup import Command as ForumCleanup | 41 from forums.management.commands import forum_cleanup |
42 | 42 |
43 # Execute Django's cleanup command (deletes old sessions). | 43 # Cleanup old sessions |
44 | 44 |
45 command = CleanupCommand() | 45 command = clearsessions.Command() |
46 command.execute() | 46 command.execute() |
47 | 47 |
48 # Execute our forum cleanup command to delete old last visit records. | 48 # Execute our forum cleanup command to delete old last visit records. |
49 | 49 |
50 command = ForumCleanup() | 50 command = forum_cleanup.Command() |
51 command.execute() | 51 command.execute() |
52 | 52 |
53 | 53 |
54 @task | 54 @task |
55 def max_users(): | 55 def max_users(): |