Skip to content

Commit d440b4f

Browse files
committed
Add multithreaded processing
1 parent 19b9cac commit d440b4f

4 files changed

Lines changed: 38 additions & 4 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/fundamental/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ base64 = { workspace = true }
2828
cpe = { workspace = true }
2929
csv = { workspace = true }
3030
flate2 ={ workspace = true }
31+
futures = { workspace = true }
3132
futures-util = { workspace = true }
3233
itertools = { workspace = true }
3334
log = { workspace = true }

modules/fundamental/src/sbom/service/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ mod test;
77

88
use trustify_common::db::Database;
99

10+
#[derive(Clone)]
1011
pub struct SbomService {
1112
db: Database,
1213
}

openapi.yaml

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ paths:
3333
parameters:
3434
- name: ingested
3535
in: query
36-
description: |-
37-
Number of days ago from current time to prune SBOMs
38-
For example, ingested=90 means prune SBOMs ingested more than 90 days ago
36+
description: Number of days ago from current time to prune SBOMs
3937
required: true
4038
schema:
4139
type: integer
@@ -72,7 +70,7 @@ paths:
7270
schema:
7371
type: array
7472
items:
75-
$ref: '#/components/schemas/PrunedSbom'
73+
$ref: '#/components/schemas/PrunedSbomLog'
7674
'500':
7775
description: Internal server error
7876
/api/v2/advisory:
@@ -4706,6 +4704,10 @@ components:
47064704
type:
47074705
- string
47084706
- 'null'
4707+
error:
4708+
type:
4709+
- string
4710+
- 'null'
47094711
ingested:
47104712
type: string
47114713
format: date-time
@@ -4721,6 +4723,35 @@ components:
47214723
type: array
47224724
items:
47234725
type: string
4726+
PrunedSbomLog:
4727+
type: object
4728+
required:
4729+
- total
4730+
- successful_total
4731+
- failed_total
4732+
- successful_pruned
4733+
- failed_pruned
4734+
properties:
4735+
failed_pruned:
4736+
type: array
4737+
items:
4738+
$ref: '#/components/schemas/PrunedSbom'
4739+
failed_total:
4740+
type: integer
4741+
format: int64
4742+
minimum: 0
4743+
successful_pruned:
4744+
type: array
4745+
items:
4746+
$ref: '#/components/schemas/PrunedSbom'
4747+
successful_total:
4748+
type: integer
4749+
format: int64
4750+
minimum: 0
4751+
total:
4752+
type: integer
4753+
format: int64
4754+
minimum: 0
47244755
Purl:
47254756
type: string
47264757
format: uri

0 commit comments

Comments
 (0)