Slide 23
Slide 23 text
Rubyでの実装例(platform-api gemを利用)
dyno = ::PlatformAPI::Dyno.new(
::PlatformAPI.connect('{{Heroku API Key}}'),
)
dyno.create(
'{{Heroku App Name}}',
attach: false, # (1)
command: %!rails r "SampleCoreJob.perform_now(shop_id: '#{shop.id}', global_executions: #{global_executions})"!,
force_no_tty: nil, # (2)
size: 'performance-m',
type: 'run',
time_to_live: 1.hour,
)
# (1) false: 標準出力/標準エラー出力をアプリログに流す
# (2) "attach: true" の時に意味があるようだ
https://rubygems.org/gems/platform-api