Documentation ¶
Index ¶
- Constants
- func CreateTestGeneration(log Logger, apiKey string) error
- type JobLogger
- type JobRunner
- func (j *JobRunner) AddFreeCreditsToEligibleUsers(log Logger) error
- func (j *JobRunner) CheckSCWorkerHealth(log Logger) error
- func (j *JobRunner) DeleteUserData(log Logger, dryRun bool) error
- func (j *JobRunner) GetAndSetStats(log Logger) error
- func (j *JobRunner) GetGenerationOutputCount() (int, error)
- func (j *JobRunner) GetUpscaleOutputCount() (int, error)
- func (j *JobRunner) GetVoiceoverOutputCount() (int, error)
- func (j *JobRunner) HandleOutputsWithNoEmbedding(log Logger) error
- func (j *JobRunner) HandleOutputsWithNoNsfwCheck(log Logger) (int, error)
- func (j *JobRunner) PruneOldQueueItems(log Logger) error
- func (j *JobRunner) RefundOldGenerationCredits(log Logger) error
- func (j *JobRunner) SendUserCleanNotification(log Logger, success bool, bannedUsersDeleted, nonBannedUsersDeleted int, ...) error
- func (j *JobRunner) StartAutoUpscaleJob(log Logger)
- func (j *JobRunner) SyncStripe(log Logger) error
- type Logger
- type RequestBody
- type ResponseBody
Constants ¶
View Source
const ( ColorSuccess = 3066993 // Green ColorError = 15158332 // Red )
View Source
const COUNT_CHECK_INTERVAL = 20
View Source
const DATA_DELETE_JOB = "USER_DATA_DELETE_JOB"
View Source
const EMBEDDINGS_JOB_NAME = "EMBEDDINGS_JOB"
View Source
const FREE_JOB_NAME = "FREE_CREDITS_JOB"
View Source
const HEALTH_JOB_NAME = "HEALTH_JOB"
View Source
const NSFW_CHECK_JOB_NAME = "NSFW_CHECK_JOB"
View Source
const NSFW_CHECK_OUTPUTS_LIMIT = 50
View Source
const OUTPUTS_LIMIT = 10
View Source
const PRUNE_OLDER_THAN = 5 * time.Minute
Prune messages older than this time
View Source
const PRUNE_OLD_QUEUE_JOB_NAME = "PRUNE_OLD_QUEUE_JOB"
Variables ¶
This section is empty.
Functions ¶
func CreateTestGeneration ¶
Types ¶
type JobRunner ¶
type JobRunner struct { Repo *repository.Repository Redis *database.RedisWrapper Ctx context.Context Discord *discord.DiscordHealthTracker Track *analytics.AnalyticsService Stripe *stripe.API S3 *s3.S3 S3Img2Img *s3.S3 Qdrant *qdrant.QdrantClient MQClient queue.MQClient CLIP *clip.ClipService AsynqClient *asynq.Client SupabaseAuth *database.SupabaseAuth HTTP *http.Client }
func (*JobRunner) AddFreeCreditsToEligibleUsers ¶
func (*JobRunner) CheckSCWorkerHealth ¶
CheckHealth cron job
func (*JobRunner) DeleteUserData ¶
func (*JobRunner) GetAndSetStats ¶
func (*JobRunner) GetGenerationOutputCount ¶
func (*JobRunner) GetUpscaleOutputCount ¶
func (*JobRunner) GetVoiceoverOutputCount ¶
func (*JobRunner) HandleOutputsWithNoEmbedding ¶
func (*JobRunner) HandleOutputsWithNoNsfwCheck ¶
func (*JobRunner) PruneOldQueueItems ¶
PruneOldQueueItems cron job
func (*JobRunner) RefundOldGenerationCredits ¶
func (*JobRunner) SendUserCleanNotification ¶
func (*JobRunner) StartAutoUpscaleJob ¶
func (*JobRunner) SyncStripe ¶
Sync stripe subscriptions with active user products
type Logger ¶
type Logger interface { Infof(s string, args ...any) Errorf(s string, args ...any) Warnf(s string, args ...any) }
Just wrap logger so we can include the job name without repeating it
type RequestBody ¶
type ResponseBody ¶
Click to show internal directories.
Click to hide internal directories.