-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwrangler.data.toml
More file actions
82 lines (70 loc) · 2.83 KB
/
wrangler.data.toml
File metadata and controls
82 lines (70 loc) · 2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# ==============================================================================
# DATA WORKER - External API calls and data management
# ==============================================================================
#
# Handles all external data operations:
# - Bitcoin price and network data (CoinGecko, blockchain APIs)
# - Weather and solar irradiance data (OpenWeatherMap, NREL)
# - Equipment specifications updates
# - Data caching and rate limiting
# - API key management and rotation
#
# Optimized for:
# - External API calls with proper rate limiting
# - Aggressive caching to minimize API costs
# - Resilient error handling and fallbacks
# - Scheduled data updates via Cron Triggers
# ==============================================================================
name = "solar-mining-data"
main = "src/server/data/index.ts"
compatibility_date = "2024-01-01"
compatibility_flags = ["nodejs_compat"]
# Development environment
[env.development]
name = "solar-mining-data-dev"
# Production environment
[env.production]
name = "solar-mining-data"
# KV namespaces for aggressive data caching (disabled for initial deployment)
# [[env.development.kv_namespaces]]
# binding = "DATA_CACHE"
# id = "data-cache-dev-namespace-id"
# preview_id = "data-cache-dev-preview-id"
# [[env.production.kv_namespaces]]
# binding = "DATA_CACHE"
# id = "data-cache-namespace-id"
# preview_id = "data-cache-preview-id"
# Rate limiting KV store (disabled for initial deployment)
# [[env.production.kv_namespaces]]
# binding = "RATE_LIMITS"
# id = "rate-limits-namespace-id"
# preview_id = "rate-limits-preview-id"
# Analytics for external API usage (disabled for initial deployment)
# [[env.production.analytics_engine_datasets]]
# binding = "DATA_ANALYTICS"
# dataset = "solar_mining_data_analytics"
# External API configuration
[env.development.vars]
BITCOIN_API_BASE_URL = "https://api.coingecko.com/api/v3"
WEATHER_API_BASE_URL = "https://api.openweathermap.org/data/2.5"
SOLAR_API_BASE_URL = "https://developer.nrel.gov/api/solar"
BLOCKCHAIN_API_BASE_URL = "https://blockstream.info/api"
[env.production.vars]
BITCOIN_API_BASE_URL = "https://api.coingecko.com/api/v3"
WEATHER_API_BASE_URL = "https://api.openweathermap.org/data/2.5"
SOLAR_API_BASE_URL = "https://developer.nrel.gov/api/solar"
BLOCKCHAIN_API_BASE_URL = "https://blockstream.info/api"
# Scheduled triggers for data updates (PRODUCTION ONLY)
# Note: Equipment database updates moved to manual user-triggered updates
# Staging: No cron triggers (for development/testing)
# Production: 2 cron triggers (Bitcoin updates + Weather refresh)
[env.production.triggers]
crons = [
"0 */6 * * *", # Every 6 hours - Bitcoin price updates
"0 12 * * 1" # Weekly Monday noon - Weather data refresh
]
# CPU limits disabled for free plan
# [limits]
# cpu_ms = 10000 # 10 seconds for external API operations
[observability]
enabled = true