v1.27.0-a #10
@ -10,6 +10,7 @@ import (
|
|||||||
|
|
||||||
"github.com/fatih/color"
|
"github.com/fatih/color"
|
||||||
logging "github.com/ipfs/go-log/v2"
|
logging "github.com/ipfs/go-log/v2"
|
||||||
|
"github.com/mitchellh/go-homedir"
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
|
|
||||||
"github.com/filecoin-project/lotus/build"
|
"github.com/filecoin-project/lotus/build"
|
||||||
@ -144,8 +145,14 @@ func main() {
|
|||||||
},
|
},
|
||||||
After: func(c *cli.Context) error {
|
After: func(c *cli.Context) error {
|
||||||
if r := recover(); r != nil {
|
if r := recover(); r != nil {
|
||||||
|
p, err := homedir.Expand(c.String(FlagMinerRepo))
|
||||||
|
if err != nil {
|
||||||
|
log.Errorw("could not expand repo path for panic report", "error", err)
|
||||||
|
panic(r)
|
||||||
|
}
|
||||||
|
|
||||||
// Generate report in LOTUS_PATH and re-raise panic
|
// Generate report in LOTUS_PATH and re-raise panic
|
||||||
build.GeneratePanicReport(c.String("panic-reports"), c.String(deps.FlagRepoPath), c.App.Name)
|
build.GeneratePanicReport(c.String("panic-reports"), p, c.App.Name)
|
||||||
panic(r)
|
panic(r)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
@ -7,6 +7,7 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
logging "github.com/ipfs/go-log/v2"
|
logging "github.com/ipfs/go-log/v2"
|
||||||
|
"github.com/mitchellh/go-homedir"
|
||||||
"golang.org/x/xerrors"
|
"golang.org/x/xerrors"
|
||||||
|
|
||||||
"github.com/filecoin-project/lotus/build"
|
"github.com/filecoin-project/lotus/build"
|
||||||
@ -41,6 +42,11 @@ func OpenFSJournal(lr repo.LockedRepo, disabled journal.DisabledEvents) (journal
|
|||||||
}
|
}
|
||||||
|
|
||||||
func OpenFSJournalPath(path string, disabled journal.DisabledEvents) (journal.Journal, error) {
|
func OpenFSJournalPath(path string, disabled journal.DisabledEvents) (journal.Journal, error) {
|
||||||
|
path, err := homedir.Expand(path)
|
||||||
|
if err != nil {
|
||||||
|
return nil, xerrors.Errorf("failed to expand repo path: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
dir := filepath.Join(path, "journal")
|
dir := filepath.Join(path, "journal")
|
||||||
if err := os.MkdirAll(dir, 0755); err != nil {
|
if err := os.MkdirAll(dir, 0755); err != nil {
|
||||||
return nil, fmt.Errorf("failed to mk directory %s for file journal: %w", dir, err)
|
return nil, fmt.Errorf("failed to mk directory %s for file journal: %w", dir, err)
|
||||||
|
Loading…
Reference in New Issue
Block a user