Skip to content

Commit cd567a9

Browse files
Fix: API request timeout
1 parent 2e72706 commit cd567a9

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

pkg/module/module.go

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,17 @@ func New(
4545
opts ...ModuleOption,
4646
) *Module {
4747
module := Module{
48-
BaseModule: modules.New("celestials"),
49-
address: address,
50-
states: state,
51-
tx: tx,
52-
celestials: v1.New(celestialsDatasource.URL),
53-
indexerName: indexerName,
54-
network: network,
55-
indexPeriod: time.Minute,
56-
databaseTimeout: time.Minute,
57-
limit: 100,
48+
BaseModule: modules.New("celestials"),
49+
address: address,
50+
states: state,
51+
tx: tx,
52+
celestials: v1.New(celestialsDatasource.URL),
53+
indexerName: indexerName,
54+
network: network,
55+
indexPeriod: time.Minute,
56+
databaseTimeout: time.Minute,
57+
limit: 100,
58+
celestialsDatasource: celestialsDatasource,
5859
}
5960

6061
for i := range opts {
@@ -133,6 +134,8 @@ func (m *Module) getChanges(ctx context.Context) (celestials.Changes, error) {
133134
}
134135

135136
func (m *Module) sync(ctx context.Context) error {
137+
m.Log.Debug().Msg("start syncing...")
138+
136139
var end bool
137140

138141
for !end {
@@ -179,6 +182,8 @@ func (m *Module) sync(ctx context.Context) error {
179182
}
180183
end = len(changes.Changes) < int(m.limit)
181184
}
185+
186+
m.Log.Debug().Msg("end syncing...")
182187
return nil
183188
}
184189

0 commit comments

Comments
 (0)