scworker

package
v0.0.0-...-11c28d2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 30 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateUpscaleInternal

func CreateUpscaleInternal(AsynqClient *asynq.Client, S3 *s3.S3, Track *analytics.AnalyticsService, Repo *repository.Repository, Redis *database.RedisWrapper, MQClient queue.MQClient, sMap *shared.SyncMap[chan requests.CogWebhookMessage], generation *ent.Generation, output *ent.GenerationOutput) error

Create an Upscale in sc-worker, wait for result ! TODO - clean this up and merge with CreateUpscale method

func ShouldUseRunpodGenerate

func ShouldUseRunpodGenerate(model *ent.GenerationModel, redis *database.RedisWrapper) bool

func ShouldUseRunpodUpscale

func ShouldUseRunpodUpscale(model *ent.UpscaleModel, redis *database.RedisWrapper) bool

Types

type SCWorker

type SCWorker struct {
	Repo           *repository.Repository
	Redis          *database.RedisWrapper
	SMap           *shared.SyncMap[chan requests.CogWebhookMessage]
	QueueThrottler *shared.UserQueueThrottlerMap
	Track          *analytics.AnalyticsService
	SafetyChecker  *translator.TranslatorSafetyChecker
	S3Img          *s3.S3
	S3             *s3.S3
	MQClient       queue.MQClient
	AsynqClient    *asynq.Client
}

type WorkerError

type WorkerError struct {
	StatusCode int

	Err error

	ErrDescription string
}

Error wrapper for GPU worker requests

func WorkerInternalServerError

func WorkerInternalServerError() *WorkerError

Suppresses internal errors

func (*WorkerError) Error

func (r *WorkerError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL