mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-17 07:37:34 -06:00
[bugfix/chore] oauth entropy fix + media cleanup tasks rewrite (#1853)
This commit is contained in:
parent
c4cf6326d8
commit
9a22102fa8
38 changed files with 2076 additions and 1090 deletions
|
|
@ -41,8 +41,23 @@ const (
|
|||
httpSigVerifierKey
|
||||
httpSigKey
|
||||
httpSigPubKeyIDKey
|
||||
dryRunKey
|
||||
)
|
||||
|
||||
// DryRun returns whether the "dryrun" context key has been set. This can be
|
||||
// used to indicate to functions, (that support it), that only a dry-run of
|
||||
// the operation should be performed. As opposed to making any permanent changes.
|
||||
func DryRun(ctx context.Context) bool {
|
||||
_, ok := ctx.Value(dryRunKey).(struct{})
|
||||
return ok
|
||||
}
|
||||
|
||||
// SetDryRun sets the "dryrun" context flag and returns this wrapped context.
|
||||
// See DryRun() for further information on the "dryrun" context flag.
|
||||
func SetDryRun(ctx context.Context) context.Context {
|
||||
return context.WithValue(ctx, dryRunKey, struct{}{})
|
||||
}
|
||||
|
||||
// RequestID returns the request ID associated with context. This value will usually
|
||||
// be set by the request ID middleware handler, either pulling an existing supplied
|
||||
// value from request headers, or generating a unique new entry. This is useful for
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue