@db_api.retry_if_session_inactive()
@db_api.context_manager.writer
def set_resources_quota_usage_dirty(context, resources, tenant_id, dirty=True):
 query = db_utils.model_query(context, quota_models.QuotaUsage)
 query = query.filter_by(tenant_id=tenant_id)
 if resources:
  query = query.filter(quota_models.QuotaUsage.resource.in_(resources))
 return query.update({'dirty': dirty}, synchronize_session=False)

@ db_api . retry_if_session_inactive ( ) @ db_api . context_manager . writer def set_resources_quota_usage_dirty ( context , resources , tenant_id , dirty = True ) : query = db_utils . model_query ( context , quota_models . QuotaUsage ) query = query . filter_by ( tenant_id = tenant_id ) if resources : query = query . filter ( quota_models . QuotaUsage . resource . in_ ( resources ) ) return query . update ( { 'dirty' : dirty } , synchronize_session = False )
set quota usage dirty bit for a given tenant and multiple resources .