I have three models User, Post, Vote
I tried to create a role-based authorization where the author (the user who creates a post/blog) can't vote for their own post/blog. To identify users, I used Hasura session variables X-Hasura-User-Id. Configuring (Row insert) Permission Rules for Vote table by,
{
"errors": [
{
"extensions": {
"path": "$.selectionSet.insert_Vote_one.args.object",
"code": "permission-error"
},
"message": "Check constraint violation. insert check constraint failed"
}
]
}
Run Code Online (Sandbox Code Playgroud)
But which given constraint violation for the …
我只是在试验工作进程,因此试试这个:
const http = require("http");
const cluster = require("cluster");
const CPUs = require("os").cpus();
const numCPUs = CPUs.length;
if (cluster.isMaster) {
console.log("This is the master process: ", process.pid);
for (let i = 0; i < numCPUs; i++) {
cluster.fork();
}
cluster.on("exit", (worker) => {
console.log(`worker process ${process.pid} has died`);
console.log(`Only ${Object.keys(cluster.workers).length} remaining...`);
});
} else {
http
.createServer((req, res) => {
res.end(`process: ${process.pid}`);
if (req.url === "/kill") {
process.exit();
}
console.log(`serving from ${process.pid}`);
})
.listen(3000);
}
Run Code Online (Sandbox Code Playgroud)
我使用负载测试来检查“请求是否分布在他们的工作进程中?” 但我得到了同样的process.pid …