Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into fix/restart-when-lo…
Browse files Browse the repository at this point in the history
…ck-not-acquired

* origin/master:
  feat: allow application name to be passed in postgres connection url (#243)
  chore: remove unused tables and views
  fix: multisig actor migration
  fix: lotus chain store is a blockstore
  feat: limit history indexer by height (#234)
  polish: Avoid duplicate work when reading receipts
  fix: missed while closing #201
  fix: gracefully disconnect from postgres on exit
  polish: use new init actor diffing logic
  fix: don't update go modules when running make
  fix: panic in multisig genesis task casting
  feat: extract msig transaction hamt
  Create lint.yml (#164)
  remove null bytes from message params (#208)
  • Loading branch information
placer14 committed Nov 18, 2020
2 parents 73809e5 + 042d470 commit 9390f5d
Show file tree
Hide file tree
Showing 24 changed files with 577 additions and 192 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: golangci-lint
on:
push:
tags:
- v*
branches:
- master
- main
pull_request:
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.13
- uses: actions/checkout@v2
- name: Make Dependencies
run: make deps && make build
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.29
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ build/.update-modules:

.PHONY: deps
deps: build/.update-modules
go get -u github.com/git-chglog/git-chglog/cmd/git-chglog

# test starts dependencies and runs all tests
.PHONY: test
Expand All @@ -57,6 +56,11 @@ testfull:
testshort:
go test -short ./... -v

# lint runs linting against code base
.PHONY: lint
lint:
go run github.com/golangci/golangci-lint/cmd/golangci-lint run

.PHONY: visor
visor:
rm -f visor
Expand All @@ -80,4 +84,4 @@ dist-clean:

.PHONY: changelog
changelog:
git-chglog -o CHANGELOG.md
go run github.com/git-chglog/git-chglog/cmd/git-chglog -o CHANGELOG.md
20 changes: 19 additions & 1 deletion commands/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import (
"errors"
"fmt"
"math"
"os"
"os/signal"
"syscall"
"time"

"github.com/filecoin-project/specs-actors/actors/builtin"
Expand Down Expand Up @@ -258,6 +261,21 @@ var Run = &cli.Command{
}
}()

// Set up a context that is canceled when the command is interrupted
ctx, cancel := context.WithCancel(ctx)
defer cancel()

// Set up a signal handler to cancel the context
go func() {
interrupt := make(chan os.Signal, 1)
signal.Notify(interrupt, syscall.SIGTERM, syscall.SIGINT)
select {
case <-interrupt:
cancel()
case <-ctx.Done():
}
}()

scheduler := schedule.NewScheduler(cctx.Duration("task-delay"))

// Add one indexing task to follow the chain head
Expand All @@ -277,7 +295,7 @@ var Run = &cli.Command{
if cctx.Bool("indexhistory") {
scheduler.Add(schedule.TaskConfig{
Name: "ChainHistoryIndexer",
Task: indexer.NewChainHistoryIndexer(rctx.db, rctx.opener, cctx.Int("indexhistory-batch")),
Task: indexer.NewChainHistoryIndexer(rctx.db, rctx.opener, cctx.Int("indexhistory-batch"), heightFrom, heightTo),
Locker: NewGlobalSingleton(ChainHistoryIndexerLockID, rctx.db), // only want one history indexer anywhere to be running
ExitOnFailure: true,
RestartOnFailure: false,
Expand Down
16 changes: 8 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ require (
contrib.go.opencensus.io/exporter/prometheus v0.1.0
github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96 // indirect
github.com/fatih/color v1.10.0 // indirect
github.com/filecoin-project/go-address v0.0.4
github.com/filecoin-project/go-bitfield v0.2.1
github.com/filecoin-project/go-fil-markets v1.0.0
github.com/filecoin-project/go-address v0.0.5-0.20201103152444-f2023ef3f5bb
github.com/filecoin-project/go-bitfield v0.2.3-0.20201110211213-fe2c1862e816
github.com/filecoin-project/go-fil-markets v1.0.4
github.com/filecoin-project/go-multistore v0.0.3
github.com/filecoin-project/go-state-types v0.0.0-20201013222834-41ea465f274f
github.com/filecoin-project/lotus v1.1.3-0.20201031000550-a5c05f87f15f
github.com/filecoin-project/lotus v1.1.4-0.20201116232018-a152d98af82b
github.com/filecoin-project/specs-actors v0.9.12
github.com/filecoin-project/specs-actors/v2 v2.2.0
github.com/filecoin-project/statediff v0.0.8-0.20201027195725-7eaa5391a639
Expand All @@ -24,10 +24,9 @@ require (
github.com/ipfs/go-block-format v0.0.2
github.com/ipfs/go-cid v0.0.7
github.com/ipfs/go-datastore v0.4.5
github.com/ipfs/go-ipfs-blockstore v1.0.1
github.com/ipfs/go-ipld-cbor v0.0.5-0.20200428170625-a0bd04d3cbdf
github.com/ipfs/go-ipld-cbor v0.0.5
github.com/ipfs/go-log/v2 v2.1.2-0.20200626104915-0016c0b4b3e4
github.com/ipld/go-ipld-prime v0.5.1-0.20200910124733-350032422383
github.com/ipld/go-ipld-prime v0.5.1-0.20201021195245-109253e8a018
github.com/jackc/pgx/v4 v4.9.0
github.com/lib/pq v1.8.0
github.com/libp2p/go-libp2p-peer v0.2.0
Expand All @@ -38,6 +37,7 @@ require (
github.com/multiformats/go-multihash v0.0.14
github.com/prometheus/client_golang v1.6.0
github.com/raulk/clock v1.1.0
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/stretchr/testify v1.6.1
github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df // indirect
github.com/urfave/cli v1.22.5 // indirect
Expand All @@ -48,7 +48,7 @@ require (
go.opentelemetry.io/otel v0.12.0
go.opentelemetry.io/otel/exporters/trace/jaeger v0.12.0
go.opentelemetry.io/otel/sdk v0.12.0
golang.org/x/sys v0.0.0-20201101102859-da207088b7d1 // indirect
golang.org/x/sys v0.0.0-20201112073958-5cba982894dd // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
gopkg.in/AlecAivazis/survey.v1 v1.8.8 // indirect
gopkg.in/kyokomi/emoji.v1 v1.5.1 // indirect
Expand Down
Loading

0 comments on commit 9390f5d

Please sign in to comment.