mirror of
https://github.com/xtr-dev/rondevu-server.git
synced 2025-12-10 02:43:24 +00:00
fix: implement upsert behavior for service creation
When a service is republished (e.g., for TTL refresh), the old service is now deleted before creating a new one, preventing UNIQUE constraint errors on (username, service_fqn). Changes: - Query for existing service before creation - Delete existing service if found - Create new service with same username/serviceFqn This enables the client's TTL auto-refresh feature to work correctly.
This commit is contained in:
@@ -61,7 +61,7 @@ export function createApp(storage: Storage, config: Config) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* POST /register
|
* POST /register
|
||||||
* Register a new peer (still needed for peer ID generation)
|
* Register a new peer
|
||||||
*/
|
*/
|
||||||
app.post('/register', async (c) => {
|
app.post('/register', async (c) => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user