uploadsession

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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