MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / run

Method run

certbot/src/bot.rs:150–181  ·  view source on GitHub ↗

Run the certbot.

(&self)

Source from the content-addressed store, hash-verified

148
149 /// Run the certbot.
150 pub async fn run(&self) {
151 loop {
152 match self.renew(false).await {
153 Ok(renewed) => {
154 if !renewed {
155 continue;
156 }
157 if let Some(hook) = &self.config.renewed_hook {
158 info!("running renewed hook");
159 let result = std::process::Command::new("/bin/sh")
160 .arg("-c")
161 .arg(hook)
162 .status();
163 match result {
164 Ok(status) => {
165 if !status.success() {
166 error!("renewed hook failed with status: {status}");
167 }
168 }
169 Err(err) => {
170 error!("failed to run renewed hook: {err:?}");
171 }
172 }
173 }
174 }
175 Err(e) => {
176 error!("failed to run certbot: {e:?}");
177 }
178 }
179 sleep(self.config.renew_interval).await;
180 }
181 }
182
183 /// Run the certbot once.
184 pub async fn renew(&self, force: bool) -> Result<bool> {

Callers 8

app.pyFile · 0.45
_analyze_git_blameMethod · 0.45
_is_spdx_only_commitMethod · 0.45
_get_commit_yearMethod · 0.45
test_outputs.pyFile · 0.45
renewFunction · 0.45
test_certbotFunction · 0.45

Calls 2

renewMethod · 0.80
statusMethod · 0.45

Tested by 1

test_certbotFunction · 0.36