vipyrsec / dragonfly-mainframe

The mainframe for Dragonfly
https://docs.vipyrsec.com/dragonfly-mainframe/
MIT License
5 stars 1 forks source link

Use only one SQL query in `POST /jobs` #223

Closed jonathan-d-zhang closed 6 months ago

jonathan-d-zhang commented 6 months ago

Instead of selecting and updating with 2 queries, simply update and get the updated rows using RETURNING.

This has the added benefit of making this operation atomic, when it was not before.

jonathan-d-zhang commented 6 months ago

Closes #220