Update sirbot

        Trigger the update method of the plugins. This is needed if the plugins
        need to perform update migration (i.e database)
17967
async def update(self):
        
        logger.info('Updating Sir Bot-a-lot')
        for name, plugin in self._plugins.items():
            plugin_update = getattr(plugin['plugin'], 'update', None)
            if callable(plugin_update):
                logger.info('Updating %s', name)
                await plugin_update(self.config.get(name, {}), self._plugins)
                logger.info('%s updated', name)
        self._session.close()
        logger.info('Sir Bot-a-lot updated')
674626
def update_trigger(self, service):
        
        now = arrow.utcnow().to(settings.TIME_ZONE).format('YYYY-MM-DD HH:mm:ssZZ')
        TriggerService.objects.filter(id=service.id).update(date_triggered=now,
                                                            consumer_failed=0,
                                                            provider_failed=0,
                                                            )
1004536
function update(instance, array, tx, callback) {
    var
        model = instance.__model,
        beforeUpdate = model.__beforeUpdate,
        updates,
        params,
        sql;
    if (beforeUpdate) {
        beforeUpdate(instance);
    }
    if (!array) {
        array = model.__updateAttributesArray;
    }
    updates = _.map(array, function (attr) {
        return '`' + attr + '`=?';
    });
    params = _.map(array, function (attr) {
        return instance[attr];
    });
    params.push(instance[model.__primaryKey]);
    sql = utils.format('update `%s` set %s where `%s`=?', model.__table, updates.join(', '), model.__primaryKey);
    smartRunSQL(model.__pool, sql, params, tx, function (err, result) {
        if (err) {
            return callback(err);
        }
        callback(null, instance);
    });
}
1077096
protected function handleUpdates()
    {
        $config = $this->app->make('config');
        if (!$config->get('concrete.maintenance_mode')) {
            try {
                $this->app->handleAutomaticUpdates();
            } catch (MutexBusyException $x) {
                if ($x->getMutexKey() !== Update::MUTEX_KEY) {
                    throw $x;
                }
                $config->set('concrete.maintenance_mode', true);
            }
            catch (MigrationIncompleteException $x) {
                $request = Request::getInstance();
                $requestUri = $request->getUri();
                $rf = $this->app->make(ResponseFactoryInterface::class);
                return $rf->redirect($requestUri, Response::HTTP_FOUND);
            }
        }
    }
518796
def update_with_masterdb(observed_method, object) #:nodoc:
      if object.class.connection.respond_to?(:with_master)
        object.class.connection.with_master do
          update_without_masterdb(observed_method, object)
        end
      else
        update_without_masterdb(observed_method, object)
      end
    end
1146879
def update(sql, *args, **kwargs):
        
        assert "update" in sql.lower(), 'This function requires an update statement, provided: {}'.format(sql)
        cursor = CoyoteDb.execute_and_commit(sql, *args, **kwargs)

        # now get that id
        last_row_id = cursor.lastrowid

        return last_row_id
437524
def update(instance, full_clean=True, post_save=False, **kwargs):
    ""

    # apply the updated args to the instance to mimic the change
    # note that these might slightly differ from the true database values
    # as the DB could have been updated by another thread. callers should
    # retrieve a new copy of the object if up-to-date values are required
    for k, v in kwargs.iteritems():
        if isinstance(v, ExpressionNode):
            v = resolve_expression_node(instance, v)
        setattr(instance, k, v)

    # clean instance before update
    if full_clean:
        instance.full_clean()

    # fields that use auto_now=True should be updated corrected, too!
    for field in instance._meta.fields:
        if hasattr(field, 'auto_now') and field.auto_now and field.name not in kwargs:
            kwargs[field.name] = field.pre_save(instance, False)

    rows_affected = instance.__class__._default_manager.filter(
        pk=instance.pk).update(**kwargs)

    if post_save:
        signals.post_save.send(sender=instance.__class__, instance=instance)

    return rows_affected
547429
async def update(self, **kwargs):
        '''
        
        '''
        try:
            self.data[self.pk] = self.pk_type(kwargs['pk'])
            updated_obj = await self._meta.object_class().update(self.db, data=self.data)
            if updated_obj is None:
                raise NotFound('Object matching the given {} was not found'.format(self.pk))
            return await updated_obj.serialize()
        except Exception as ex:
            logger.exception(ex)
            raise BadRequest(ex)
1215888
def update(self, **kwargs):
        """"""
        assert not self.called
        self.kw.update(kwargs)
        return self
946322
public function update(PluginBundleInterface $plugin, $currentVersion, $targetVersion)
    {
        $this->checkInstallationStatus($plugin, true);
        $this->validator->activeUpdateMode();
        $this->validatePlugin($plugin);
        $this->validator->deactivateUpdateMode();
        $this->log('Updating plugin configuration...');
        $this->baseInstaller->update($plugin, $currentVersion, $targetVersion);
        $this->recorder->update($plugin, $this->validator->getPluginConfiguration());
    }
666573
public function actionUpdate()
	{
		$collection = \App::$domain->tool->openServer->update();
		$hosts = ArrayHelper::getColumn($collection, 'host');
		Output::items($hosts, count($collection) . ' hosts');
		Output::line();
	}
903569
def update(self, instance, **kwargs):
        
        for index in self.model_to_indexes[instance.__class__]:
            if not index._doc_type.ignore_signals:
                index.update(instance, **kwargs)
594624
protected function updateTrigger()
    {
        $this->controlAccess('trigger_edit');

        if ($this->trigger->update($this->data_trigger['trigger_id'], $this->getSubmitted())) {
            $this->redirect('admin/settings/trigger', $this->text('Trigger has been updated'), 'success');
        }

        $this->redirect('', $this->text('Trigger has not been updated'), 'warning');
    }
778233
def update(self, name=None, algorithm=None, protocol=None, halfClosed=None,
            port=None, timeout=None, httpsRedirect=None):
        
        return self.manager.update(self, name=name, algorithm=algorithm,
                protocol=protocol, halfClosed=halfClosed, port=port,
                timeout=timeout, httpsRedirect=httpsRedirect)
676689
def method_missing method, *args, &block
        message = ::NRSER::Message.new method, *args, &block
        @current = message.send_to @current
        @updates << ::NRSER::HistoryUpdate.new \
          message: message,
          response: @current
      end
284822
public function updateLegacyPluginsParams()
    {
        //Renaming a legacy database table field otherwise cli would break
        $db = AnService::get('anahita:domain.store.database');
        $pluginColumns = $db->getColumns('plugins');

        if (isset($pluginColumns['params'])) {
           $db->execute('ALTER TABLE `#__plugins` CHANGE `params` `meta` text DEFAULT NULL');
           $db->execute('ALTER TABLE `#__plugins` CHANGE `published` `enabled` tinyint(3) NOT NULL DEFAULT 0');
           $db->execute('DROP INDEX `idx_folder` ON `#__plugins`');
           $db->execute('ALTER TABLE `#__plugins` ADD INDEX `idx_folder` (`enabled`, `folder`)');
           print "Please run the previous command one more time!\n";
           exit(0);
        }
    }
996177
def automations_update_many(self, data, **kwargs):
        ""
        api_path = "/api/v2/automations/update_many.json"
        return self.call(api_path, method="PUT", data=data, **kwargs)