Schedules a Jenkins upgrade.
557624
@RequirePOST
    public void doUpgrade(StaplerResponse rsp) throws IOException, ServletException {
        HudsonUpgradeJob job = new HudsonUpgradeJob(getCoreSource(), Jenkins.getAuthentication());
        if(!Lifecycle.get().canRewriteHudsonWar()) {
            sendError("Jenkins upgrade not supported in this running mode");
            return;
        }

        LOGGER.info("Scheduling the core upgrade");
        addJob(job);
        rsp.sendRedirect2(".");
    }
734109
def schedule(self, task):
        """"""
        self.task_manager.register(task)
        self.worker_manager.dispatch(task)
1301706
def upgrade(self, name, params=None):
        """"""
        # Allow non-namespaced upgrades. (e.g. advanced vs logging:advanced)
        if ':' not in name:
            name = '{0}:{1}'.format(self.type, name)

        r = self._h._http_resource(
            method='PUT',
            resource=('apps', self.app.name, 'addons', quote(name)),
            params=params,
            data=' '   # Server weirdness.
        )
        r.raise_for_status()
        return self.app.addons[name]
251608
def change(self, key, value):
        """"""
        self.obj[key] = value
        self.changes.append("Updating build:{}.{}={}"
                            .format(self.obj['name'], key, value))
        return self
427130
def scheduled(wait=False):
    """"""
    manager.run_scheduled()
    while wait:
        # Loop and try to run scheduled crawlers at short intervals
        manager.run_scheduled()
        time.sleep(settings.SCHEDULER_INTERVAL)
764164
def do_upgrade():
    """"""
    op.alter_column(
        table_name='knwKBRVAL',
        column_name='id_knwKB',
        type_=db.MediumInteger(8, unsigned=True),
        existing_nullable=False,
        existing_server_default='0'
    )
186895
@Override
    public void upgrade() {
        // All default rotation strategy settings.
        final MessageCountRotationStrategyConfig messageCountRotationStrategyConfig = clusterConfigService.get(MessageCountRotationStrategyConfig.class);
        final SizeBasedRotationStrategyConfig sizeBasedRotationStrategyConfig = clusterConfigService.get(SizeBasedRotationStrategyConfig.class);
        final TimeBasedRotationStrategyConfig timeBasedRotationStrategyConfig = clusterConfigService.get(TimeBasedRotationStrategyConfig.class);

        if (messageCountRotationStrategyConfig == null) {
            final MessageCountRotationStrategyConfig countConfig = MessageCountRotationStrategyConfig.create(elasticsearchConfiguration.getMaxDocsPerIndex());
            clusterConfigService.write(countConfig);
            LOG.info("Migrated \"{}\" setting: {}", "elasticsearch_max_docs_per_index", countConfig);
        }
        if (sizeBasedRotationStrategyConfig == null) {
            final SizeBasedRotationStrategyConfig sizeConfig = SizeBasedRotationStrategyConfig.create(elasticsearchConfiguration.getMaxSizePerIndex());
            clusterConfigService.write(sizeConfig);
            LOG.info("Migrated \"{}\" setting: {}", "elasticsearch_max_size_per_index", sizeConfig);
        }
        if (timeBasedRotationStrategyConfig == null) {
            final TimeBasedRotationStrategyConfig timeConfig = TimeBasedRotationStrategyConfig.create(elasticsearchConfiguration.getMaxTimePerIndex());
            clusterConfigService.write(timeConfig);
            LOG.info("Migrated \"{}\" setting: {}", "elasticsearch_max_time_per_index", timeConfig);
        }

        // All default retention strategy settings
        final ClosingRetentionStrategyConfig closingRetentionStrategyConfig = clusterConfigService.get(ClosingRetentionStrategyConfig.class);
        final DeletionRetentionStrategyConfig deletionRetentionStrategyConfig = clusterConfigService.get(DeletionRetentionStrategyConfig.class);

        if (closingRetentionStrategyConfig == null) {
            final ClosingRetentionStrategyConfig closingConfig = ClosingRetentionStrategyConfig.create(elasticsearchConfiguration.getMaxNumberOfIndices());
            clusterConfigService.write(closingConfig);
            LOG.info("Migrated \"{}\" setting: {}", "elasticsearch_max_number_of_indices", closingConfig);
        }

        if (deletionRetentionStrategyConfig == null) {
            final DeletionRetentionStrategyConfig deletionConfig = DeletionRetentionStrategyConfig.create(elasticsearchConfiguration.getMaxNumberOfIndices());
            clusterConfigService.write(deletionConfig);
            LOG.info("Migrated \"{}\" setting: {}", "elasticsearch_max_number_of_indices", deletionConfig);
        }

        // Selected rotation and retention strategies.
        final IndexManagementConfig indexManagementConfig = clusterConfigService.get(IndexManagementConfig.class);
        if (indexManagementConfig == null) {
            final Class<? extends RotationStrategy> rotationStrategyClass;
            switch (elasticsearchConfiguration.getRotationStrategy()) {
                case "size":
                    rotationStrategyClass = SizeBasedRotationStrategy.class;
                    break;
                case "time":
                    rotationStrategyClass = TimeBasedRotationStrategy.class;
                    break;
                case "count":
                    rotationStrategyClass = MessageCountRotationStrategy.class;
                    break;
                default:
                    LOG.warn("Unknown retention strategy \"{}\"", elasticsearchConfiguration.getRotationStrategy());
                    rotationStrategyClass = MessageCountRotationStrategy.class;
            }

            final Class<? extends RetentionStrategy> retentionStrategyClass;
            switch (elasticsearchConfiguration.getRetentionStrategy()) {
                case "close":
                    retentionStrategyClass = ClosingRetentionStrategy.class;
                    break;
                case "delete":
                    retentionStrategyClass = DeletionRetentionStrategy.class;
                    break;
                default:
                    LOG.warn("Unknown retention strategy \"{}\"", elasticsearchConfiguration.getRetentionStrategy());
                    retentionStrategyClass = DeletionRetentionStrategy.class;
            }

            final IndexManagementConfig config = IndexManagementConfig.create(
                    rotationStrategyClass.getCanonicalName(),
                    retentionStrategyClass.getCanonicalName());
            clusterConfigService.write(config);
            LOG.info("Migrated \"{}\" and \"{}\" setting: {}", "rotation_strategy", "retention_strategy", config);
        }

        final SearchesClusterConfig searchesClusterConfig = clusterConfigService.get(SearchesClusterConfig.class);
        if (searchesClusterConfig == null) {
            final SearchesClusterConfig config = SearchesClusterConfig.createDefault();
            LOG.info("Creating searches cluster config: {}", config);
            clusterConfigService.write(config);
        }
    }
965410
def Schedule(self, tasks, mutation_pool, timestamp=None):
    """"""
    non_fleetspeak_tasks = []
    for queue, queued_tasks in iteritems(
        collection.Group(tasks, lambda x: x.queue)):
      if not queue:
        continue

      client_id = _GetClientIdFromQueue(queue)
      if fleetspeak_utils.IsFleetspeakEnabledClient(
          client_id, token=self.token):
        for task in queued_tasks:
          fleetspeak_utils.SendGrrMessageThroughFleetspeak(client_id, task)
        continue
      non_fleetspeak_tasks.extend(queued_tasks)

    timestamp = timestamp or self.frozen_timestamp
    mutation_pool.QueueScheduleTasks(non_fleetspeak_tasks, timestamp)
1121608
def upgrade(directory=None, revision='head', sql=False, tag=None, x_arg=None):
    """"""
    config = current_app.extensions['migrate'].migrate.get_config(directory,
                                                                  x_arg=x_arg)
    command.upgrade(config, revision, sql=sql, tag=tag)
249503
def upgrade():
    """"""
    op.create_table(
        'oauth2server_client',
        sa.Column('name', sa.String(length=40), nullable=True),
        sa.Column('description', sa.Text(), nullable=True),
        sa.Column(
            'website',
            sqlalchemy_utils.types.url.URLType(),
            nullable=True),
        sa.Column('user_id', sa.Integer(), nullable=True),
        sa.Column('client_id', sa.String(length=255), nullable=False),
        sa.Column('client_secret', sa.String(length=255), nullable=False),
        sa.Column(
            'is_confidential',
            sa.Boolean(name='is_confidential'),
            nullable=True),
        sa.Column(
            'is_internal',
            sa.Boolean(name='is_internal'),
            nullable=True),
        sa.Column('_redirect_uris', sa.Text(), nullable=True),
        sa.Column('_default_scopes', sa.Text(), nullable=True),
        sa.ForeignKeyConstraint(['user_id'], [u'accounts_user.id'], ),
        sa.PrimaryKeyConstraint('client_id')
    )
    op.create_index(
        op.f('ix_oauth2server_client_client_secret'),
        'oauth2server_client',
        ['client_secret'],
        unique=True
    )
    op.create_table(
        'oauth2server_token',
        sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('client_id', sa.String(length=255), nullable=False),
        sa.Column('user_id', sa.Integer(), nullable=True),
        sa.Column('token_type', sa.String(length=255), nullable=True),
        sa.Column(
            'access_token',
            sqlalchemy_utils.EncryptedType(),
            nullable=True),
        sa.Column(
            'refresh_token',
            sqlalchemy_utils.EncryptedType(),
            nullable=True),
        sa.Column('expires', sa.DateTime(), nullable=True),
        sa.Column('_scopes', sa.Text(), nullable=True),
        sa.Column(
            'is_personal',
            sa.Boolean(name='is_personal'),
            nullable=True),
        sa.Column(
            'is_internal',
            sa.Boolean(name='is_internal'),
            nullable=True),
        sa.ForeignKeyConstraint(
            ['client_id'], [u'oauth2server_client.client_id'], ),
        sa.ForeignKeyConstraint(
            ['user_id'], [u'accounts_user.id'], ),
        sa.PrimaryKeyConstraint('id')
    )
    op.create_index(
        'ix_oauth2server_token_access_token',
        'oauth2server_token',
        ['access_token'],
        unique=True,
        mysql_length=255)
    op.create_index(
        'ix_oauth2server_token_refresh_token',
        'oauth2server_token',
        ['refresh_token'],
        unique=True,
        mysql_length=255)
1198358
public void schedule() {
        // randomize the scheduling so that multiple Hudson instances will write at the file at different time
        long MINUTE = 1000*60;

        Timer.get()
            .schedule(new SafeTimerTask() {
                protected void doRun() {
                    execute();
                }
            }, (random.nextInt(30) + 60) * MINUTE, TimeUnit.MILLISECONDS);
    }
90092
def _schedule(self):
        ''''''
        if self._running:
            _logger.debug('')
            self._call_later_handle = self._event_loop.call_later(
                self._timeout, self._check)
943505
def schedule(dev):
    
    # TODO: expose setting the schedule somehow?
    for d in range(7):
        dev.query_schedule(d)
    for day in dev.schedule.values():
        click.echo("Day %s, base temp: %s" % (day.day, day.base_temp))
        current_hour = day.next_change_at
        for hour in day.hours:
            if current_hour == 0: continue
            click.echo("\t[%s-%s] %s" % (current_hour, hour.next_change_at, hour.target_temp))
            current_hour = hour.next_change_at
464838
private void scheduleUpdate() {
		if (!isVisible()) {
			return;
		}
		
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				try {
					container.gameLoop();
				} catch (SlickException e) {
					e.printStackTrace();
				}
				container.checkDimensions();
				scheduleUpdate();
			}
		});
	}
140919
def _callUpgradeAgent(self, ev_data, failTimeout) -> None:
        

        logger.info("{}'s upgrader calling agent for upgrade".format(self))
        self._actionLog.append_started(ev_data)
        self._action_start_callback()
        self.scheduledAction = None
        asyncio.ensure_future(
            self._sendUpgradeRequest(ev_data, failTimeout))
342813
def upgrade():
    """"""
    current_date = datetime.utcnow()

    # Add 'created' and 'updated' columns to RemoteAccount
    _add_created_updated_columns('oauthclient_remoteaccount', current_date)

    # Add 'created' and 'updated' columns to RemoteToken
    _add_created_updated_columns('oauthclient_remotetoken', current_date)

    # Add 'created' and 'updated' columns to UserIdentity
    _add_created_updated_columns('oauthclient_useridentity', current_date)
1074387
def update(self, client):
        """"""
        update_cmd = "{sudo} '{refresh};{update}'".format(
            sudo=self.get_sudo_exec_wrapper(),
            refresh=self.get_refresh_repo_cmd(),
            update=self.get_update_cmd()
        )

        out = ''
        try:
            out = ipa_utils.execute_ssh_command(
                client,
                update_cmd
            )
        except Exception as error:
            raise IpaDistroException(
                'An error occurred updating instance: %s' % error
            )
        return out