master
cost
def cost last_update = if state == 'Finished' || state == 'Stopped' updated_at.to_i else Time.now.to_i