Whenever the county board and mayor and council or other legislative body in a city have voted to unite in the carrying out of any of the objects provided for in sections 47-302 to 47-308, both city and county shall be bound to continue the contract and operate and maintain the jail and land for the employment of prisoners, unless both agree to discontinue or abandon the same.