---
# System prepended metadata

title: 投注記錄重新拉取

---

# 投注記錄重新拉取
```bash!
cd /ror
docker-compose exec sidekiq bash
```
container
```bash!
cd /home/deploy/casino_entertainment_city_h6/current
bin/rails c -e production
```
in rails console
```ruby!
    start_time = Time.current
    date = (date || (start_time.beginning_of_day == start_time.change({ sec: 0 }) ? Time.zone.yesterday : Time.zone.today)).to_s
    bet_service = BetHistoryService.new
    Parallel.each(SubPlatform.all) do |platform|
      bet_service.daily_settlements(platform.betting_record_system_name, date)
      next unless bet_service.daily_betting_records.present?

      bet_service.update_betting_record!
    end
```