Skip to content

Commit

Permalink
prod config hour
Browse files Browse the repository at this point in the history
  • Loading branch information
bharattech committed Aug 7, 2023
1 parent 1327400 commit b0177d6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
17 changes: 8 additions & 9 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,32 +40,32 @@ fn handle_serverless_events(_req: Request) -> Result<Response> {
eprintln!("Error while fetching last_fetch_at: {}", err);
let now_date = Utc::now().to_string();
store.set("last_fetch_at", &now_date)?;
println!("set_last_fetch_at: {}", now_date);
//println!("set_last_fetch_at: {}", now_date);
now_date
}
};

let date_now = Utc::now();
let diff: Duration = date_now
.signed_duration_since(Utc.datetime_from_str(&last_fetch_at, "%Y-%m-%d %H:%M:%S%.f UTC")?);
let one_hour = Duration::minutes(1);
let one_hour = Duration::minutes(60);

println!("date_now: {}", date_now);
println!("last_fetch_at: {}", &last_fetch_at);
// println!("date_now: {}", date_now);
// println!("last_fetch_at: {}", &last_fetch_at);

if diff > one_hour {
let now_date = Utc::now().to_string();
store.set("last_fetch_at", &now_date)?;
println!("set_last_fetch_at: {}", now_date);
//println!("set_last_fetch_at: {}", now_date);

for loc_url in &meetup_loc {
println!("{}", loc_url);
//println!("{}", loc_url);
let body = fetch_meetup_upcoming_event(loc_url)?;
parse_meetup_fragment(body, loc_url, &mut array_events)
}

for loc_url in &hasgeek_loc {
println!("hasgeek_loc, {}", loc_url);
//println!("hasgeek_loc, {}", loc_url);
let body = fetch_hasgeek_upcoming_data(loc_url)?;
parse_hasgeek_fragment(body, loc_url, &mut array_events);
}
Expand Down Expand Up @@ -224,7 +224,7 @@ fn parse_hasgeek_fragment(
}
} else {
//hasgeek past events
println!("hasgeek_past events, {}", loc_url);
//println!("hasgeek_past events, {}", loc_url);
let past_body = fetch_hasgeek_past_data(loc_url);

parse_hasgeek_past_event_fragment(past_body.unwrap(), loc_url, array_events)
Expand Down Expand Up @@ -338,7 +338,6 @@ fn fetch_meetup_past_event(location: &str) -> Result<String> {

fn fetch_hasgeek_upcoming_data(location: &str) -> Result<String> {
let url = format!("{}/{}", HASGEEK_BASE_URL, location);
println!("{}",url);
fetch_html(&url)
}

Expand Down
2 changes: 1 addition & 1 deletion target/.rustc_info.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"rustc_fingerprint":601557531088797714,"outputs":{"15729799797837862367":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/home/ws-hp-2023/.rustup/toolchains/stable-x86_64-unknown-linux-gnu\noff\npacked\nunpacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nunix\n","stderr":""},"14371922958718593042":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/home/ws-hp-2023/.rustup/toolchains/stable-x86_64-unknown-linux-gnu\noff\npacked\nunpacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nunix\n","stderr":""},"17351682911112135739":{"success":true,"status":"","code":0,"stdout":"___.wasm\nlib___.rlib\n___.wasm\nlib___.a\n/home/ws-hp-2023/.rustup/toolchains/stable-x86_64-unknown-linux-gnu\noff\n___\ndebug_assertions\npanic=\"abort\"\nproc_macro\ntarget_arch=\"wasm32\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_family=\"wasm\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"wasi\"\ntarget_pointer_width=\"32\"\ntarget_vendor=\"unknown\"\n","stderr":"warning: dropping unsupported crate type `dylib` for target `wasm32-wasi`\n\nwarning: dropping unsupported crate type `proc-macro` for target `wasm32-wasi`\n\nwarning: 2 warnings emitted\n\n"},"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.70.0 (90c541806 2023-05-31)\nbinary: rustc\ncommit-hash: 90c541806f23a127002de5b4038be731ba1458ca\ncommit-date: 2023-05-31\nhost: x86_64-unknown-linux-gnu\nrelease: 1.70.0\nLLVM version: 16.0.2\n","stderr":""}},"successes":{}}
{"rustc_fingerprint":601557531088797714,"outputs":{"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.70.0 (90c541806 2023-05-31)\nbinary: rustc\ncommit-hash: 90c541806f23a127002de5b4038be731ba1458ca\ncommit-date: 2023-05-31\nhost: x86_64-unknown-linux-gnu\nrelease: 1.70.0\nLLVM version: 16.0.2\n","stderr":""},"17351682911112135739":{"success":true,"status":"","code":0,"stdout":"___.wasm\nlib___.rlib\n___.wasm\nlib___.a\n/home/ws-hp-2023/.rustup/toolchains/stable-x86_64-unknown-linux-gnu\noff\n___\ndebug_assertions\npanic=\"abort\"\nproc_macro\ntarget_arch=\"wasm32\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_family=\"wasm\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"wasi\"\ntarget_pointer_width=\"32\"\ntarget_vendor=\"unknown\"\n","stderr":"warning: dropping unsupported crate type `dylib` for target `wasm32-wasi`\n\nwarning: dropping unsupported crate type `proc-macro` for target `wasm32-wasi`\n\nwarning: 2 warnings emitted\n\n"},"15729799797837862367":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/home/ws-hp-2023/.rustup/toolchains/stable-x86_64-unknown-linux-gnu\noff\npacked\nunpacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nunix\n","stderr":""},"14371922958718593042":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/home/ws-hp-2023/.rustup/toolchains/stable-x86_64-unknown-linux-gnu\noff\npacked\nunpacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nunix\n","stderr":""}},"successes":{}}
Binary file modified target/wasm32-wasi/release/deps/serverless_events.wasm
Binary file not shown.
Binary file modified target/wasm32-wasi/release/serverless_events.wasm
Binary file not shown.

0 comments on commit b0177d6

Please sign in to comment.