forked from DreamLab-AI/VisionClaw
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsync_trigger.rs
More file actions
44 lines (34 loc) · 1.41 KB
/
sync_trigger.rs
File metadata and controls
44 lines (34 loc) · 1.41 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
// Simple sync trigger
use std::sync::Arc;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
println!("🔄 GitHub Sync Trigger - multi-ontology branch");
println!("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
// Set environment
std::env::set_var("FORCE_FULL_SYNC", "1");
println!("GITHUB_BRANCH: {}", std::env::var("GITHUB_BRANCH")?);
println!("FORCE_FULL_SYNC: {}", std::env::var("FORCE_FULL_SYNC")?);
println!("NEO4J_URI: {}", std::env::var("NEO4J_URI")?);
println!("");
// Make HTTP call to sync endpoint
let client = reqwest::Client::new();
let pubkey = std::env::var("POWER_USER_PUBKEYS")?;
println!("Calling http://localhost:4000/api/admin/sync...");
let response = client
.post("http://localhost:4000/api/admin/sync")
.header("Content-Type", "application/json")
.header("X-Nostr-Pubkey", pubkey)
.timeout(std::time::Duration::from_secs(600))
.send()
.await?;
let status = response.status();
let body = response.text().await?;
println!("Status: {}", status);
println!("Response: {}", body);
if status.is_success() {
println!("✅ Sync triggered successfully!");
} else {
println!("❌ Sync failed with status: {}", status);
}
Ok(())
}