use celery routers from gvacommon
This commit is contained in:
		
							parent
							
								
									70045771c9
								
							
						
					
					
						commit
						672a3bb622
					
				
					 3 changed files with 4 additions and 22 deletions
				
			
		|  | @ -1,6 +1,8 @@ | |||
| Changelog | ||||
| ========= | ||||
| 
 | ||||
| * :support:`-` use celery routers from gvacommon | ||||
| 
 | ||||
| * :release:`0.1.3 <2014-12-26>` | ||||
| * :support:`-` add celery routing for file server tasks | ||||
| 
 | ||||
|  |  | |||
|  | @ -291,8 +291,8 @@ CELERY_RESULT_BACKEND = 'amqp' | |||
| CELERY_RESULT_PERSISTENT = True | ||||
| CELERY_TASK_RESULT_EXPIRES = None | ||||
| CELERY_ROUTES = ( | ||||
|     'osusers.tasks.LdapRouter', | ||||
|     'osusers.tasks.FileRouter', | ||||
|     'gvacommon.celeryrouters.LdapRouter', | ||||
|     'gvacommon.celeryrouters.FileRouter', | ||||
| ) | ||||
| CELERY_ACCEPT_CONTENT = ['pickle', 'yaml', 'json'] | ||||
| CELERY_TASK_SERAILIZER = 'json' | ||||
|  |  | |||
|  | @ -21,26 +21,6 @@ from ldapentities.models import ( | |||
| _logger = get_task_logger(__name__) | ||||
| 
 | ||||
| 
 | ||||
| class LdapRouter(object): | ||||
| 
 | ||||
|     def route_for_task(self, task, args=None, kwargs=None): | ||||
|         if 'ldap' in task: | ||||
|             return {'exchange': 'ldap', | ||||
|                     'exchange_type': 'direct', | ||||
|                     'queue': 'ldap'} | ||||
|         return None | ||||
| 
 | ||||
| 
 | ||||
| class FileRouter(object): | ||||
| 
 | ||||
|     def route_for_task(self, task, args=None, kwargs=None): | ||||
|         if 'file' in task: | ||||
|             return {'exchange': 'file', | ||||
|                     'exchange_type': 'direct', | ||||
|                     'queue': 'file'} | ||||
|         return None | ||||
| 
 | ||||
| 
 | ||||
| @shared_task | ||||
| def create_ldap_group(groupname, gid, descr): | ||||
|     """ | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue