Changeset 667 in code for trunk/downstream.go
- Timestamp:
- Nov 3, 2021, 5:21:05 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/downstream.go
r666 r667 1329 1329 ch := net.channels.Value(target) 1330 1330 1331 ctx, cancel := context.WithTimeout(context.TODO(), messageStoreTimeout) 1332 defer cancel() 1333 1331 1334 limit := 4000 1332 1335 targetCM := net.casemap(target) 1333 history, err := dc.user.msgStore.LoadLatestID( &net.Network, targetCM, msgID, limit)1336 history, err := dc.user.msgStore.LoadLatestID(ctx, &net.Network, targetCM, msgID, limit) 1334 1337 if err != nil { 1335 1338 dc.logger.Printf("failed to send backlog for %q: %v", target, err) … … 2335 2338 eventPlayback := dc.caps["draft/event-playback"] 2336 2339 2340 ctx, cancel := context.WithTimeout(context.TODO(), messageStoreTimeout) 2341 defer cancel() 2342 2337 2343 var history []*irc.Message 2338 2344 switch subcommand { 2339 2345 case "BEFORE": 2340 history, err = store.LoadBeforeTime( &network.Network, entity, bounds[0], time.Time{}, limit, eventPlayback)2346 history, err = store.LoadBeforeTime(ctx, &network.Network, entity, bounds[0], time.Time{}, limit, eventPlayback) 2341 2347 case "AFTER": 2342 history, err = store.LoadAfterTime( &network.Network, entity, bounds[0], time.Now(), limit, eventPlayback)2348 history, err = store.LoadAfterTime(ctx, &network.Network, entity, bounds[0], time.Now(), limit, eventPlayback) 2343 2349 case "BETWEEN": 2344 2350 if bounds[0].Before(bounds[1]) { 2345 history, err = store.LoadAfterTime( &network.Network, entity, bounds[0], bounds[1], limit, eventPlayback)2351 history, err = store.LoadAfterTime(ctx, &network.Network, entity, bounds[0], bounds[1], limit, eventPlayback) 2346 2352 } else { 2347 history, err = store.LoadBeforeTime( &network.Network, entity, bounds[0], bounds[1], limit, eventPlayback)2353 history, err = store.LoadBeforeTime(ctx, &network.Network, entity, bounds[0], bounds[1], limit, eventPlayback) 2348 2354 } 2349 2355 case "TARGETS": 2350 2356 // TODO: support TARGETS in multi-upstream mode 2351 targets, err := store.ListTargets( &network.Network, bounds[0], bounds[1], limit, eventPlayback)2357 targets, err := store.ListTargets(ctx, &network.Network, bounds[0], bounds[1], limit, eventPlayback) 2352 2358 if err != nil { 2353 2359 dc.logger.Printf("failed fetching targets for chathistory: %v", err)
Note:
See TracChangeset
for help on using the changeset viewer.