Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternative approach to previous PR. #4

Merged
merged 28 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
6276f91
Merge pull request #3 from varsnothing/vn/feat/EC-002-ec-001-tenancy-…
varsnothing Jan 25, 2024
1f92f16
Merge pull request #5 from varsnothing/dev
varsnothing Jan 26, 2024
5e12dcb
Merge pull request #6 from varsnothing/encord
varsnothing Jan 26, 2024
f277e1f
ar(feat) flowtime(2:05): preparing navbar for features, add user acti…
angeloreale Jan 26, 2024
dc483be
ar(feat) starting the day with a basepath
angeloreale Jan 27, 2024
e8dadbb
ar(feat) adding insta
angeloreale Jan 27, 2024
b9540cc
ar(feat) so much to do, so little time. mui/base, HELPS. also, workin…
angeloreale Jan 27, 2024
8b0afbc
ar(feat) flowtime(freestyle) oplog+mutex+Nachus+NexusDB+etc
angeloreale Jan 27, 2024
5bd6a02
ar(debug) race-condition: logs at least more readable.
angeloreale Jan 27, 2024
5414e9c
ar(feat) I will focus better tomorrow. Part of my weekend unwind proc…
angeloreale Jan 27, 2024
83a2ef4
ar(feat) Flowing better, better logs... I need to write now, brb.
angeloreale Jan 28, 2024
9215eb7
ar(rabbit) sometimes i go deep, and I feel like there is no way back …
angeloreale Jan 29, 2024
bdc89ea
ar(feat) flow:shuffling:pickingup
angeloreale Feb 6, 2024
edb39fd
ar(feat) flow:reduce-logs
angeloreale Feb 6, 2024
a7e83ae
ar(kiss)
angeloreale Feb 6, 2024
a8e2f38
ar(kiss) then update iface
angeloreale Feb 6, 2024
c496e3e
ar(preporg)
angeloreale Feb 6, 2024
7fb7ce6
ar(schemas)
angeloreale Feb 6, 2024
798ace5
ar(enforce default org)
angeloreale Feb 6, 2024
e3bf878
ar(slow and easy)
angeloreale Feb 6, 2024
081fdda
ar(feat) flow:init:default:org
angeloreale Feb 6, 2024
e413540
ar(cleanup)
angeloreale Feb 6, 2024
2945bf7
ar(cleanup)
angeloreale Feb 6, 2024
6dff444
ar(cleanup)
angeloreale Feb 6, 2024
c1625f3
ar(cleanup)
angeloreale Feb 6, 2024
5b1dc83
ar(cleanup)
angeloreale Feb 6, 2024
b67ed82
ar(build)
angeloreale Feb 6, 2024
050fd6e
ar(lock-file)
angeloreale Feb 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ar(feat) I will focus better tomorrow. Part of my weekend unwind proc…
…ess is doing random refactors like this. It soothes me and makes me think clearer about things.
  • Loading branch information
angeloreale committed Jan 27, 2024
commit 5414e9cc192b3c840713714b1f48eec0c4c10336
6 changes: 3 additions & 3 deletions lib/model/interfaces/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
// to-do: let's make an @helpers alias!
import { NexusDB } from "@model"

export const patience = async () => {
export const patience = async (sleep = 1000) => {
console.log({ NexusDB })
if (!NexusDB.oplog?.length) {
NexusDB.log({
type: "mongodb",
action: "database",
verb: "wating a bit",
status: "read:halt",
message: `Nexus is busy, please take deep breathes...`,
message: `Nexus is busy, please take ${sleep / 1000} deep breathes...`,
})
}
return setTimeout(()=>patience(), 10000)
return setTimeout(()=>patience(), sleep)
}
73 changes: 37 additions & 36 deletions lib/model/interfaces/mdb-get-interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,46 +7,47 @@ import { getUserCollection } from "@controller";
import { DATABASE_STRING as databaseName } from "./constants";
import { patience } from "./helpers";


console.log("===== get iface ======")

/* public */
export const getUserMeta = async ({
email = "",
options
}: Pick<UserSchema, "email">) => {
const getUser = (email?: string) => {

NexusDB.log({
type: "mongodb",
action: "database",
verb: "getting user",
status: "read:started",
message: `loading user from database`,
})

const collection = await NexusDB.getUsers()

await patience()


const user = await collection.findOne({ email });


console.log({ user })

if(!user) {
}
NexusDB.dispatch(async () => {
NexusDB.log({
type: "mongodb",
action: "database",
verb: "getting user",
status: "read:error",
message: `user was not found`,
})


}
NexusDB.log({
type: "mongodb",
action: "database",
verb: "getting user",
status: "read:done",
message: `user:${user?._id} was loaded successfully`,
})
return user;
type: "mongodb",
action: "database",
verb: "getting user",
status: "read:started",
message: `loading user from database`,
})

return await NexusDB.dispatch(async () => {
const users = await NexusDB.users();
const user = await users.findOne({ email });

if(!user) {
NexusDB.log({
type: "mongodb",
action: "database",
verb: "getting user",
status: "read:error",
message: `user was not found`,
})
}
NexusDB.log({
type: "mongodb",
action: "database",
verb: "getting user",
status: "read:done",
message: `user:${user?._id} was loaded successfully`,
})
return user;
}, options)
}, options)
};
Loading