How to force Rails ActiveRecord to commit a transaction flush

后端 未结 2 1924
自闭症患者
自闭症患者 2021-02-14 00:00

Is it possible to force ActiveRecord to push/flush a transaction (or just a save/create)?

I have a clock worker that creates tasks in the background for several task wor

2条回答
  •  名媛妹妹
    2021-02-14 00:16

    execute uses async_exec under the hood which may or may not be what you want. You could try using the lower level methods execute_and_clear (or even exec_no_cache) instead.

提交回复
热议问题