Started stress testing script [CI SKIP]

This commit is contained in:
Jef Roosens 2022-01-30 14:13:37 +01:00
parent ae579f83b5
commit 4c56351132
Signed by untrusted user: Jef Roosens
GPG key ID: B580B976584B5F30
5 changed files with 136 additions and 7 deletions

View file

@ -76,9 +76,17 @@ fn (mut app App) put_package() web.Result {
added := app.repo.add_from_path(pkg_path) or {
app.lerror('Error while adding package: $err.msg')
os.rm(pkg_path) or {
app.lerror("Failed to remove download '$pkg_path'.")
}
return app.text('Failed to add package.')
}
if !added {
os.rm(pkg_path) or {
app.lerror("Failed to remove download '$pkg_path'.")
}
app.lwarn('Duplicate package.')
return app.text('File already exists.')