-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NFT Metadata Crawler] Asset Uploader Throttler (#14904)
* yay * upsert * awesome * AHHHHHHHHHHHHHHHHHHHHHHH * boom * boom * lint * lint
- Loading branch information
1 parent
622e42e
commit 416cb79
Showing
13 changed files
with
633 additions
and
22 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
pub mod api; | ||
pub mod throttler; | ||
pub mod worker; |
33 changes: 33 additions & 0 deletions
33
ecosystem/nft-metadata-crawler/src/asset_uploader/throttler/config.rs
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,33 @@ | ||
// Copyright © Aptos Foundation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Clone, Debug, Deserialize, Serialize)] | ||
#[serde(deny_unknown_fields)] | ||
pub struct AssetUploaderThrottlerConfig { | ||
/// URI for the Asset Uploader Worker | ||
pub asset_uploader_worker_uri: String, | ||
/// Interval in seconds to poll Postgres to update upload queue | ||
#[serde(default = "AssetUploaderThrottlerConfig::default_poll_interval_seconds")] | ||
pub poll_interval_seconds: u64, | ||
/// Maximum number of rows to poll from Postgres | ||
#[serde(default = "AssetUploaderThrottlerConfig::default_poll_rows_limit")] | ||
pub poll_rows_limit: u64, | ||
/// Cloudflare Account Hash provided at the images home page used for generating the CDN image URLs | ||
pub cloudflare_account_hash: String, | ||
/// Cloudflare Image Delivery URL prefix provided at the images home page used for generating the CDN image URLs | ||
pub cloudflare_image_delivery_prefix: String, | ||
/// In addition to on the fly transformations, Cloudflare images can be returned in preset variants. This is the default variant used with the saved CDN image URLs. | ||
pub cloudflare_default_variant: String, | ||
} | ||
|
||
impl AssetUploaderThrottlerConfig { | ||
pub const fn default_poll_interval_seconds() -> u64 { | ||
10 | ||
} | ||
|
||
pub const fn default_poll_rows_limit() -> u64 { | ||
600 | ||
} | ||
} |
Oops, something went wrong.