uzamaki21
uzamaki21
CCConvex Community
Created by uzamaki21 on 12/15/2024 in #support-community
I currently run a cron job every 20 sec but its using bandwidth a lot how can i reduce the bandwidth
sure
55 replies
CCConvex Community
Created by uzamaki21 on 12/15/2024 in #support-community
I currently run a cron job every 20 sec but its using bandwidth a lot how can i reduce the bandwidth
sure ill take a look thank you
55 replies
CCConvex Community
Created by uzamaki21 on 12/15/2024 in #support-community
I currently run a cron job every 20 sec but its using bandwidth a lot how can i reduce the bandwidth
thank you so much that would be a great help
55 replies
CCConvex Community
Created by uzamaki21 on 12/15/2024 in #support-community
I currently run a cron job every 20 sec but its using bandwidth a lot how can i reduce the bandwidth
ok i ll look into using index while filtering
55 replies
CCConvex Community
Created by uzamaki21 on 12/15/2024 in #support-community
I currently run a cron job every 20 sec but its using bandwidth a lot how can i reduce the bandwidth
until this month
55 replies
CCConvex Community
Created by uzamaki21 on 12/15/2024 in #support-community
I currently run a cron job every 20 sec but its using bandwidth a lot how can i reduce the bandwidth
and im in lockdown
55 replies
CCConvex Community
Created by uzamaki21 on 12/15/2024 in #support-community
I currently run a cron job every 20 sec but its using bandwidth a lot how can i reduce the bandwidth
cause i have exceded my convex plan
55 replies
CCConvex Community
Created by uzamaki21 on 12/15/2024 in #support-community
I currently run a cron job every 20 sec but its using bandwidth a lot how can i reduce the bandwidth
so could you explain what the ideal fix could be done here
55 replies
CCConvex Community
Created by uzamaki21 on 12/15/2024 in #support-community
I currently run a cron job every 20 sec but its using bandwidth a lot how can i reduce the bandwidth
export const mutateStock = mutation({
args: {
stock: v.object({
symbol: v.string(),
name: v.string(),
open: v.number(),
high: v.number(),
low: v.number(),
close: v.number(),
volume: v.number(),
change: v.number(),
percentChange: v.number(),
ltp: v.number(),
}),
},
handler: async (ctx, args) => {
const stockRecord = await ctx.db
.query("stock")
.filter((q) => q.eq(q.field("symbol"), args.stock.symbol))
.first();
if (stockRecord) {
return await ctx.db.patch(stockRecord._id, {
...args.stock,
timestamp: Date.now(),
});
}
return await ctx.db.insert("stock", {
...args.stock,
timestamp: Date.now(),
});
},
});
export const mutateStock = mutation({
args: {
stock: v.object({
symbol: v.string(),
name: v.string(),
open: v.number(),
high: v.number(),
low: v.number(),
close: v.number(),
volume: v.number(),
change: v.number(),
percentChange: v.number(),
ltp: v.number(),
}),
},
handler: async (ctx, args) => {
const stockRecord = await ctx.db
.query("stock")
.filter((q) => q.eq(q.field("symbol"), args.stock.symbol))
.first();
if (stockRecord) {
return await ctx.db.patch(stockRecord._id, {
...args.stock,
timestamp: Date.now(),
});
}
return await ctx.db.insert("stock", {
...args.stock,
timestamp: Date.now(),
});
},
});
55 replies
CCConvex Community
Created by uzamaki21 on 12/15/2024 in #support-community
I currently run a cron job every 20 sec but its using bandwidth a lot how can i reduce the bandwidth
No description
55 replies
CCConvex Community
Created by uzamaki21 on 12/15/2024 in #support-community
I currently run a cron job every 20 sec but its using bandwidth a lot how can i reduce the bandwidth
sure
55 replies
CCConvex Community
Created by uzamaki21 on 12/15/2024 in #support-community
I currently run a cron job every 20 sec but its using bandwidth a lot how can i reduce the bandwidth
No description
55 replies
CCConvex Community
Created by uzamaki21 on 12/15/2024 in #support-community
I currently run a cron job every 20 sec but its using bandwidth a lot how can i reduce the bandwidth
No description
55 replies
CCConvex Community
Created by uzamaki21 on 12/15/2024 in #support-community
I currently run a cron job every 20 sec but its using bandwidth a lot how can i reduce the bandwidth
only 1 query and 1 mutation
55 replies
CCConvex Community
Created by uzamaki21 on 12/15/2024 in #support-community
I currently run a cron job every 20 sec but its using bandwidth a lot how can i reduce the bandwidth
hmmm the thing is im writing 304 rows to a table and reading the same thing so was wondering how index would help in reading all the rows im not filtering anything
55 replies
CCConvex Community
Created by uzamaki21 on 12/15/2024 in #support-community
I currently run a cron job every 20 sec but its using bandwidth a lot how can i reduce the bandwidth
@erquhart
55 replies
CCConvex Community
Created by uzamaki21 on 12/15/2024 in #support-community
I currently run a cron job every 20 sec but its using bandwidth a lot how can i reduce the bandwidth
a single write takes about 68kb and read takes ~10mb
55 replies
CCConvex Community
Created by uzamaki21 on 12/15/2024 in #support-community
I currently run a cron job every 20 sec but its using bandwidth a lot how can i reduce the bandwidth
No description
55 replies
CCConvex Community
Created by uzamaki21 on 12/15/2024 in #support-community
I currently run a cron job every 20 sec but its using bandwidth a lot how can i reduce the bandwidth
why is read more expensive than write
55 replies
CCConvex Community
Created by uzamaki21 on 12/15/2024 in #support-community
I currently run a cron job every 20 sec but its using bandwidth a lot how can i reduce the bandwidth
No description
55 replies