Trying to clean up things so they load faster.

This commit is contained in:
Scott Idem
2024-09-16 15:41:06 -04:00
parent c7b48ca97a
commit d122d1fb93
2 changed files with 41 additions and 31 deletions

View File

@@ -57,17 +57,17 @@ async function check_hosted_file_obj_w_hash(
// Updated 2024-03-29
async function handle_load_ae_obj_id__site_domain(
{
api_cfg,
fqdn,
try_cache=false,
timeout=7000,
log_lvl=0
api_cfg,
fqdn,
try_cache = false,
timeout = 7000,
log_lvl = 0
}: {
api_cfg: any,
fqdn: string,
try_cache: boolean,
timeout: number,
log_lvl: number
api_cfg: any,
fqdn: string,
try_cache?: boolean,
timeout?: number,
log_lvl?: number
}
) {
console.log(`*** handle_load_ae_obj_id__site_domain() *** fqdn=${fqdn}`);
@@ -118,25 +118,25 @@ async function handle_load_ae_obj_id__site_domain(
// Updated 2024-03-29
async function handle_load_ae_obj_code__data_store(
{
api_cfg,
code,
data_type='text',
for_type=null,
for_id=null,
try_cache=true,
save_idb=false,
timeout=9000,
log_lvl=0
api_cfg,
code,
data_type = 'text',
for_type = null,
for_id = null,
try_cache = true,
save_idb = false,
timeout = 9000,
log_lvl = 0
}: {
api_cfg: any,
code: string,
data_type: string,
for_type: string|null,
for_id: string|null,
try_cache: boolean,
save_idb: boolean,
timeout: number,
log_lvl: number
api_cfg: any,
code: string,
data_type?: string,
for_type?: string|null,
for_id?: string|null,
try_cache?: boolean,
save_idb?: boolean,
timeout?: number,
log_lvl?: number
}
) {
if (log_lvl) {

View File

@@ -56,6 +56,7 @@ let ae_loc_init: key_val = {
// properties: params, route, url
// functions: fetch, setHeaders, parent, depends, untrack
export async function load({ fetch, params, parent, route, url }) { // params, route, url
let log_lvl = 0;
// console.log(`Svelte root layout.ts params:`, params);
// console.log(`Svelte root layout.ts route:`, route);
// console.log(`Svelte root layout.ts url:`, url);
@@ -131,8 +132,12 @@ export async function load({ fetch, params, parent, route, url }) { // params, r
// ae_loc.site_domain = data.url.origin;
// console.log(`ae_loc = `, ae_loc);
account_id = await core_func.handle_load_ae_obj_id__site_domain({api_cfg: ae_api_init, fqdn: url.host, try_cache: false, log_lvl: 1})
account_id = await core_func.handle_load_ae_obj_id__site_domain({
api_cfg: ae_api_init,
fqdn: url.host,
try_cache: false,
log_lvl: log_lvl
})
.then(function (site_domain_results) {
if (site_domain_results) {
// console.log(`ae_ site_domain_results = `, site_domain_results);
@@ -181,7 +186,12 @@ export async function load({ fetch, params, parent, route, url }) { // params, r
ds_code = 'hub__page__access_code_li_json';
// console.log(`INFO: ae_ account_id = `, account_id);
// ae_acct['ds'][ds_code]
ds_code_li[ds_code] = await core_func.handle_load_ae_obj_code__data_store({api_cfg: ae_api_init, code: ds_code, data_type: ds_type, save_idb: false})
ds_code_li[ds_code] = await core_func.handle_load_ae_obj_code__data_store({
api_cfg: ae_api_init,
code: ds_code,
data_type: ds_type,
save_idb: false
})
.then(function (ds_results) {
if (ds_results) {
console.log(`ae_ ds_results = `, ds_results);