You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
package bootstrap
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"github.com/cloudreve/Cloudreve/v3/models/scripts/invoker"
|
|
|
|
"github.com/cloudreve/Cloudreve/v3/pkg/util"
|
|
|
|
)
|
|
|
|
|
|
|
|
func RunScript(name string) {
|
|
|
|
ctx, cancel := context.WithCancel(context.Background())
|
|
|
|
defer cancel()
|
|
|
|
if err := invoker.RunDBScript(name, ctx); err != nil {
|
|
|
|
util.Log().Error("Failed to execute database script: %s", err)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
util.Log().Info("Finish executing database script %q.", name)
|
|
|
|
}
|