我有一个使用标准 https 克隆语法的项目已经有一段时间了,就在今天下午它运行良好。现在,我error code 128每次尝试克隆时都会得到:
Obtaining myproject from git+git://myurl/myuser/myproject.git@master#egg=myproject (from -r requirements.txt (line 28))
...
fatal: unable to connect to myurl:
myurl[0: x.y.z.q]: errno=Invalid argument
ERROR: Command errored out with exit status 128: git clone -q git://myurl/myuser/myproject.git Check the logs for full command output.
Run Code Online (Sandbox Code Playgroud)
我已经确认我可以使用手动克隆
git clone -q https://myurl/myuser/myproject.git
以及通过SSH。
我在 gitea 上托管我的存储库,但我没有发现任何与此相关的错误。这很奇怪。
有谁知道会出什么问题?我什至删除了我的 virtualenv 文件夹并在没有运气的情况下重新实例化了它,并重新启动了我的 gitea 服务器。
我有一个特定的类用于与需要初始化的服务进行交互。在应用程序生命周期中,唯一有意义的地方是应用程序的启动,因为没有它,Spring 应用程序的其余部分就无法运行。我有这样做的想法:
@SpringBootApplication
public class MyApplication {
public static void main(String[] args) {
try {
MyRequiredService mrs = new MyRequiredService();
mrs.connect(); // This will throw if it fails
run(MyApplication.class, args);
} catch(MyException e) {
System.out.println("Failed to connect to MyRequiredService!");
}
}
}
Run Code Online (Sandbox Code Playgroud)
这将启动服务并尝试连接,但我有一个大问题。如何在应用程序中传递此类?我需要它在我正在编写的服务端点中的功能。
我没有看到任何明显的东西,搜索“在 Spring Boot 应用程序中传递类实例”会出现一堆不相关的主题。
在 Spring Boot 中是否有一种聪明、干净的方法来做到这一点?我为一个人为的例子道歉。该服务的名称足够独特,我不想违反任何协议。