Exemple #1
0
func (d *Deployment) watchCurrentVersion() error {
	currentVersion := d.currentVersion()

	lastWaitIndex := uint64(0)

	for range util.NotShutdown() {
		newCurrentVersion, newWaitIndex, err := d.fetchCurrentVersion(lastWaitIndex)
		if err != nil {
			return err
		}

		lastWaitIndex = newWaitIndex

		d.diffCurrentVersion(currentVersion, newCurrentVersion)
		currentVersion = newCurrentVersion
	}

	return nil
}
Exemple #2
0
func (d *Deployment) watchVersions() error {
	versions := []string{}

	lastWaitIndex := uint64(0)

	for range util.NotShutdown() {
		newVersions, nextWaitIndex, err := d.fetchVersions(lastWaitIndex)
		if err != nil {
			return err
		}

		d.diffVersions(versions, newVersions)

		versions = newVersions
		lastWaitIndex = nextWaitIndex
	}

	return nil
}