MCPcopy Index your code
hub / github.com/cloudtty/cloudtty / nextRequeueTimeDuration

Function nextRequeueTimeDuration

pkg/controllers/cloudshell_controller.go:384–398  ·  view source on GitHub ↗
(cloudshell *cloudshellv1alpha1.CloudShell)

Source from the content-addressed store, hash-verified

382}
383
384func nextRequeueTimeDuration(cloudshell *cloudshellv1alpha1.CloudShell) *time.Duration {
385 if cloudshell.Spec.TTLSecondsAfterStarted != nil {
386 startTime := metav1.Now()
387 if cloudshell.Status.LastScheduleTime != nil {
388 startTime = *cloudshell.Status.LastScheduleTime
389 }
390
391 ttl := time.Second * time.Duration(*cloudshell.Spec.TTLSecondsAfterStarted)
392
393 duration := time.Until(startTime.Add(ttl))
394 return &duration
395 }
396
397 return nil
398}
399
400// StartupWorkerFor copy kubeConfig and start ttyd
401func (c *Controller) StartupWorkerFor(ctx context.Context, cloudshell *cloudshellv1alpha1.CloudShell) error {

Callers 1

syncCloudShellMethod · 0.85

Calls 1

AddMethod · 0.65

Tested by

no test coverage detected