-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #822 from amvanbaren/bugfix/issue-819
Fix "unique_extension_public_id" unique constraint violation
- Loading branch information
Showing
18 changed files
with
1,271 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
server/src/main/java/org/eclipse/openvsx/adapter/VSCodeIdDailyUpdateJobRequestHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** ****************************************************************************** | ||
* Copyright (c) 2023 Precies. Software Ltd and others | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* ****************************************************************************** */ | ||
package org.eclipse.openvsx.adapter; | ||
|
||
import org.jobrunr.jobs.lambdas.JobRequest; | ||
import org.jobrunr.jobs.lambdas.JobRequestHandler; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
@ConditionalOnProperty(value = "ovsx.data.mirror.enabled", havingValue = "false", matchIfMissing = true) | ||
public class VSCodeIdDailyUpdateJobRequestHandler implements JobRequestHandler<JobRequest> { | ||
|
||
@Autowired | ||
VSCodeIdUpdateService service; | ||
|
||
@Override | ||
public void run(JobRequest request) throws Exception { | ||
service.updateAll(); | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
server/src/main/java/org/eclipse/openvsx/adapter/VSCodeIdNewExtensionJobRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** ****************************************************************************** | ||
* Copyright (c) 2023 Precies. Software Ltd and others | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* ****************************************************************************** */ | ||
package org.eclipse.openvsx.adapter; | ||
|
||
import org.jobrunr.jobs.lambdas.JobRequest; | ||
import org.jobrunr.jobs.lambdas.JobRequestHandler; | ||
|
||
public class VSCodeIdNewExtensionJobRequest implements JobRequest { | ||
|
||
private String namespace; | ||
private String extension; | ||
|
||
public VSCodeIdNewExtensionJobRequest() {} | ||
|
||
public VSCodeIdNewExtensionJobRequest(String namespace, String extension) { | ||
this.namespace = namespace; | ||
this.extension = extension; | ||
} | ||
|
||
@Override | ||
public Class<? extends JobRequestHandler> getJobRequestHandler() { | ||
return VSCodeIdNewExtensionJobRequestHandler.class; | ||
} | ||
|
||
public String getNamespace() { | ||
return namespace; | ||
} | ||
|
||
public void setNamespace(String namespace) { | ||
this.namespace = namespace; | ||
} | ||
|
||
public String getExtension() { | ||
return extension; | ||
} | ||
|
||
public void setExtension(String extension) { | ||
this.extension = extension; | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
server/src/main/java/org/eclipse/openvsx/adapter/VSCodeIdNewExtensionJobRequestHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** ****************************************************************************** | ||
* Copyright (c) 2023 Precies. Software Ltd and others | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* ****************************************************************************** */ | ||
package org.eclipse.openvsx.adapter; | ||
|
||
import org.jobrunr.jobs.lambdas.JobRequestHandler; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class VSCodeIdNewExtensionJobRequestHandler implements JobRequestHandler<VSCodeIdNewExtensionJobRequest> { | ||
|
||
@Autowired | ||
VSCodeIdUpdateService service; | ||
|
||
@Override | ||
public void run(VSCodeIdNewExtensionJobRequest jobRequest) throws Exception { | ||
var namespaceName = jobRequest.getNamespace(); | ||
var extensionName = jobRequest.getExtension(); | ||
service.update(namespaceName, extensionName); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.