'Refresh the in_use count on the QuotaUsage objects.
The QuotaUsage objects are created if they don\'t exist.'

def _quota_refresh(self, keys):

    def get_sync(resource, usage):
        def sync(elevated, project_id, user_id):
            return {resource: usage}
        return sync
    resources = {}
    for i in range(4):
        resource = ('resource%d' % i)
        if (i == 2):
            resource = 'fixed_ips'
        if (i == 3):
            resource = 'floating_ips'
        sync_name = ('_sync_%s' % resource)
        resources[resource] = quota.ReservableResource(resource, sync_name, ('quota_res_%d' % i))
        setattr(sqlalchemy_api, sync_name, get_sync(resource, (i + 1)))
        sqlalchemy_api.QUOTA_SYNC_FUNCTIONS[sync_name] = getattr(sqlalchemy_api, sync_name)
    db.quota_usage_refresh(self.ctxt, resources, keys, until_refresh=3, max_age=0, project_id=self.project_id, user_id=self.user_id)
