@@ -282,27 +282,22 @@ func UpdateRunner(ctx context.Context, r *ActionRunner, cols ...string) error {
282282}
283283
284284// DeleteRunner deletes a runner by given ID.
285- func DeleteRunner (ctx context.Context , id int64 ) error {
286- runner , err := GetRunnerByID (ctx , id )
287- if err != nil {
288- return err
289- }
290-
285+ func DeleteRunner (ctx context.Context , r * ActionRunner ) error {
291286 // Replace the UUID, which was either based on the secret's first 16 bytes or an UUIDv4,
292287 // with a sequence of 8 0xff bytes followed by the little-endian version of the record's
293288 // identifier. This will prevent the deleted record's identifier from colliding with any
294289 // new record.
295290 b := make ([]byte , 8 )
296- binary .LittleEndian .PutUint64 (b , uint64 (id ))
297- runner .UUID = fmt .Sprintf ("ffffffff-ffff-ffff-%.2x%.2x-%.2x%.2x%.2x%.2x%.2x%.2x" ,
291+ binary .LittleEndian .PutUint64 (b , uint64 (r . ID ))
292+ r .UUID = fmt .Sprintf ("ffffffff-ffff-ffff-%.2x%.2x-%.2x%.2x%.2x%.2x%.2x%.2x" ,
298293 b [0 ], b [1 ], b [2 ], b [3 ], b [4 ], b [5 ], b [6 ], b [7 ])
299294
300- err = UpdateRunner (ctx , runner , "UUID" )
295+ err : = UpdateRunner (ctx , r , "UUID" )
301296 if err != nil {
302297 return err
303298 }
304299
305- _ , err = db .DeleteByID [ActionRunner ](ctx , id )
300+ _ , err = db .DeleteByID [ActionRunner ](ctx , r . ID )
306301 return err
307302}
308303
0 commit comments