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:
 | 
					            if default_target:
 | 
				
			||||||
                target_site = 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
 | 
					        else:
 | 
				
			||||||
        redis_client.expire(
 | 
					            # Just Update TTL
 | 
				
			||||||
            schedule_store_key,
 | 
					            redis_client.expire(
 | 
				
			||||||
            current_app.config['DEVICE_TIMEOUT']
 | 
					                schedule_store_key,
 | 
				
			||||||
        )
 | 
					                current_app.config['DEVICE_TIMEOUT']
 | 
				
			||||||
 | 
					            )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return jsonify(self._resolve_response(target_site))
 | 
					        return jsonify(self._resolve_response(target_site))
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user