|  |  | @ -65,7 +65,10 @@ class Queue(object): | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     def empty(self): |  |  |  |     def empty(self): | 
			
		
	
		
		
			
				
					
					|  |  |  |         """Removes all messages on the queue.""" |  |  |  |         """Removes all messages on the queue.""" | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         job_list = self.get_jobs() | 
			
		
	
		
		
			
				
					
					|  |  |  |         self.connection.delete(self.key) |  |  |  |         self.connection.delete(self.key) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         for job in job_list: | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             job.cancel() | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     def is_empty(self): |  |  |  |     def is_empty(self): | 
			
		
	
		
		
			
				
					
					|  |  |  |         """Returns whether the current queue is empty.""" |  |  |  |         """Returns whether the current queue is empty.""" | 
			
		
	
	
		
		
			
				
					|  |  | @ -151,7 +154,7 @@ class Queue(object): | 
			
		
	
		
		
			
				
					
					|  |  |  |         job = Job.create(func, args, kwargs, connection=self.connection, |  |  |  |         job = Job.create(func, args, kwargs, connection=self.connection, | 
			
		
	
		
		
			
				
					
					|  |  |  |                          result_ttl=result_ttl, status=Status.QUEUED, |  |  |  |                          result_ttl=result_ttl, status=Status.QUEUED, | 
			
		
	
		
		
			
				
					
					|  |  |  |                          description=description, dependency=after) |  |  |  |                          description=description, dependency=after) | 
			
		
	
		
		
			
				
					
					|  |  |  |          |  |  |  | 
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         # If job depends on an unfinished job, register itself on it's |  |  |  |         # If job depends on an unfinished job, register itself on it's | 
			
		
	
		
		
			
				
					
					|  |  |  |         # parent's waitlist instead of enqueueing it. |  |  |  |         # parent's waitlist instead of enqueueing it. | 
			
		
	
		
		
			
				
					
					|  |  |  |         # If WatchError is raised in the process, that means something else is |  |  |  |         # If WatchError is raised in the process, that means something else is | 
			
		
	
	
		
		
			
				
					|  |  | @ -168,7 +171,7 @@ class Queue(object): | 
			
		
	
		
		
			
				
					
					|  |  |  |                         break |  |  |  |                         break | 
			
		
	
		
		
			
				
					
					|  |  |  |                     except WatchError: |  |  |  |                     except WatchError: | 
			
		
	
		
		
			
				
					
					|  |  |  |                         continue |  |  |  |                         continue | 
			
		
	
		
		
			
				
					
					|  |  |  |              |  |  |  | 
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         return self.enqueue_job(job, timeout=timeout) |  |  |  |         return self.enqueue_job(job, timeout=timeout) | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     def enqueue(self, f, *args, **kwargs): |  |  |  |     def enqueue(self, f, *args, **kwargs): | 
			
		
	
	
		
		
			
				
					|  |  | @ -219,7 +222,7 @@ class Queue(object): | 
			
		
	
		
		
			
				
					
					|  |  |  |         the properties `origin` and `enqueued_at`. |  |  |  |         the properties `origin` and `enqueued_at`. | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         If Queue is instantiated with async=False, job is executed immediately. |  |  |  |         If Queue is instantiated with async=False, job is executed immediately. | 
			
		
	
		
		
			
				
					
					|  |  |  |         """               |  |  |  |         """ | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         # Add Queue key set |  |  |  |         # Add Queue key set | 
			
		
	
		
		
			
				
					
					|  |  |  |         self.connection.sadd(self.redis_queues_keys, self.key) |  |  |  |         self.connection.sadd(self.redis_queues_keys, self.key) | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | 
 |