reduced redis access count
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				continuous-integration/drone/push Build is passing
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	continuous-integration/drone/push Build is passing
				
			This commit is contained in:
		@@ -66,12 +66,13 @@ class AssignmentView(FlaskView):
 | 
			
		||||
 | 
			
		||||
            if default_target:
 | 
			
		||||
                target_site = default_target
 | 
			
		||||
                redis_client.set(schedule_store_key, default_target)
 | 
			
		||||
                redis_client.set(schedule_store_key, default_target, ex=current_app.config['DEVICE_TIMEOUT'])
 | 
			
		||||
 | 
			
		||||
        # Update (or set) TTL
 | 
			
		||||
        redis_client.expire(
 | 
			
		||||
            schedule_store_key,
 | 
			
		||||
            current_app.config['DEVICE_TIMEOUT']
 | 
			
		||||
        )
 | 
			
		||||
        else:
 | 
			
		||||
            # Just Update TTL
 | 
			
		||||
            redis_client.expire(
 | 
			
		||||
                schedule_store_key,
 | 
			
		||||
                current_app.config['DEVICE_TIMEOUT']
 | 
			
		||||
            )
 | 
			
		||||
 | 
			
		||||
        return jsonify(self._resolve_response(target_site))
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user