uploadsession

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TakeoverIdleTimeout is intentionally more aggressive than passive cleanup:
	// a new reservation for the same tuple is direct evidence of demand.
	TakeoverIdleTimeout = 5 * time.Minute
	// CleanupIdleTimeout must remain at least TakeoverIdleTimeout so background
	// cleanup is no more aggressive than an explicit reservation takeover.
	CleanupIdleTimeout = 15 * time.Minute
)

Variables

This section is empty.

Functions

func Inactive

func Inactive(cutoff int64) []predicate.Upload

Inactive returns the canonical idle-session predicate used by both candidate selection and fenced deletion.

func InactiveByID

func InactiveByID(uploadID, cutoff int64) []predicate.Upload

InactiveByID scopes the canonical idle-session predicate to one upload.

Types

type DeleteResult

type DeleteResult struct {
	Deleted bool
	Task    *ent.StorageDeletion
}

DeleteResult reports whether a conditional deletion committed and carries the durable outbox task for callers that process deletions inline.

func DeleteIfInactive

func DeleteIfInactive(ctx context.Context, db *ent.Client, uploadID int64, folderName string, cutoff int64) (DeleteResult, error)

DeleteIfInactive atomically deletes an idle upload and enqueues its folder. A concurrent activity refresh or deletion returns a zero DeleteResult.

Jump to

Keyboard shortcuts

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