996
state *deploymentspb.VersionLocalState,
997
rg *deploymentpb.RoutingConfig,
999
>
versionDataChanged := false
1000
>
// apply changes to state based on routing config
1001
>
if newStatus != enumspb.WORKER_DEPLOYMENT_VERSION_STATUS_UNSPECIFIED {
1002
>
// In UNSPECIFIED case the routing info doesn't affect the status of this version. It just needs to propagate to
1003
>
// task queues (not sure if it happens in practice though.)
1004
>
1005
>
// As of now, the only thing that affects version data is the status
1006
>
versionDataChanged = state.Status != newStatus
1007
>
state.Status = newStatus
1008
>
state.CurrentSinceTime = nil
1009
>
state.RampingSinceTime = nil
1010
>
state.RampPercentage = 0
1011
>
switch newStatus {
1012
case enumspb.WORKER_DEPLOYMENT_VERSION_STATUS_CURRENT:
1013
state.CurrentSinceTime = rg.GetCurrentVersionChangedTime()