Openshift runs my connect(); and disconnect(); functions too late - json

I deployed my 7mb app into openshift and heroku. It works fine on heroku but on openshift it takes almost 2 minutes to run my io.sockets.on('connection', function(socket){}); and socket.on('disconnect', function () {}); functions(Other socket functions run fast enough). This causes huge problems because I use setTimeFout function in my code.
Note: While pushing my files to openshift I used to get
" openshift failed to execute 'control start' node-modules/bin/express
"
error. So I deleted express file at "myapp/node-modules/bin/express" and it worked.
Versions:
ruby: 1.9.3p0
node: 5.3.0
socket.io: 1.3.7
express: 3.0.0
My package.json file for openshift is as following.(I don't have much information about preparing json file so I use default one)
{
"name": "OpenShift-Sample-App",
"version": "1.0.0",
"description": "OpenShift Sample Application",
"keywords": [
"OpenShift",
"Node.js",
"application",
"openshift"
],
"author": {
"name": "OpenShift",
"email": "ramr#example.org",
"url": "http://www.openshift.com/"
},
"homepage": "http://www.openshift.com/",
"repository": {
"type": "git",
"url": "https://github.com/openshift/origin-server"
},
"engines": {
"node": ">= 0.6.0",
"npm": ">= 1.0.0"
},
"dependencies": {
"express": "~3.4.4"
},
"devDependencies": {},
"bundleDependencies": [],
"private": true,
"main": "server.js"
}
Thus my actual question is;
Does openshift normally runs these functions that slow or is it happening because of my mistakes?
Edit: The delay time is decreased from 2 minutes to 14 seconds. Eventhough I didn't change or repush anything.
Edit2: The delay time for connection is decreased from 14 seconds to 9 seconds by itself. And the delay time for disconnection still takes 2 minutes. My players have to wait 2 minutes to find out a player is left my game.

Related

All Google Cloud Functions fail to deploy

I have two projects in Google Cloud, both using Firebase. In Firebase I'm adding the Trigger Email extension that needs to deploy a Google Function. In one project it succeeds and the other fails. I can't seem to deploy ANY function that I write, even the simplest example.
Below is what I'm getting with one of my deploy attempts. Any help is greatly appreciated.
{
"protoPayload": {
"#type": "type.googleapis.com/google.cloud.audit.AuditLog",
"status": {
"code": 13,
"message": "Function deployment failed due to a health check failure. This usually indicates that your code was built successfully but failed during a test execution. Examine the logs to determine the cause. Try deploying again in a few minutes if it appears to be transient."
},
"authenticationInfo": {
"principalEmail": "xxxxxxxxxxxxxxxxxxx"
},
"serviceName": "cloudfunctions.googleapis.com",
"methodName": "google.cloud.functions.v1.CloudFunctionsService.UpdateFunction",
"resourceName": "projects/wod-rewards/locations/us-central1/functions/ext-firestore-send-email-processQueue"
},
"insertId": "-xxxxxxxxx",
"resource": {
"type": "cloud_function",
"labels": {
"function_name": "ext-firestore-send-email-processQueue",
"project_id": "xxxxxxxx",
"region": "us-central1"
}
},
"timestamp": "2022-02-14T20:39:25.365473Z",
"severity": "ERROR",
"logName": "projects/wod-rewards/logs/cloudaudit.googleapis.com%2Factivity",
"operation": {
"id": "operations/xxxxxxxx",
"producer": "cloudfunctions.googleapis.com",
"last": true
},
"receiveTimestamp": "2022-02-14T20:39:25.706517396Z"
}
You should check your logs for Cloud Functions in Google Cloud, might be possible that you ahve a configuration issue with your billing settings blocking you from excecute some tasks from your functions

How to fix "/bin/bash: [command] command not found" after setting up tasks.json and c_cpp_properties.json for C++ on Windows 10 VS Code?

I have configured my task.json and c_cpp_properties.json so that I may compile my main.cpp program. In order to proceed, I must press
Ctrl + Shift + B
As soon as I do a terminal pops up and alters me of an error:
Executing task in folder C++: C:\MinGW\bin\g++.exe -g main.cpp -o c:\Users\Me\Desktop\C++\.vscode\tasks.exe <
/bin/bash: C:MinGWbing++.exe: command not found
The terminal process terminated with exit code: 127
Terminal will be reused by tasks, press any key to close it.
I don't why this is happening since I've already checked that MinGW is installed in my computer with the correct PATH. To ensure that I do I typed the following in the terminal:
g++ --version
g++ (MinGW.org GCC-8.2.0-3) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
I also checked the path according to this figure
The only closest problem related to mine is in this Github link. I've also already tried changing the file directory shown in the code below using this thread but I still encounter this error.
Here are my JSON files which are inside my .vscode file:
tasks.json:
{
"version": "2.0.0",
"tasks": [
{
"label": "echo",
"type": "shell",
"command": "C:\\MinGW\\bin\\g++.exe",
"args": [
"-g",
"main.cpp",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": []
}
]
}
c_cpp_properties.json:
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.17134.0",
"compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.14.26428/bin/Hostx64/x64/cl.exe",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "msvc-x64",
"browse": {
"path": [
"${workspaceRoot}",
"C:\\MinGW\\lib\\gcc\\mingw32\\8.2.0\\include\\c++"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
],
"version": 4
}
I should expect to see a ".exe" after compiling but I can't due to the error.
After spending two days messing around with this I've finally able to correct setup C++ on VS Code and resolved the error.
According to the png image from above, I've included "C:\MinGW\bin" within the user variable "Path" under the dialogue box "User variables for Me". After a simple restart on my computer, I was able to build my project (Shift + Ctrl + B) with no problems.

VirtualBox crashes after starting gdb in Visual Studio Code

I'm a new apprentice at my company, so I'm new to Stackoverflow and coding in general, please bear with me.
I wanted to get away from the text editors (gedit and geany) I used before and started looking for an IDE. I chose to use Visual Studio Code, and started setting it up. I had to set up a compiler and a debugger. The compiler worked, but the debugger is making trouble.
I am running Debian 64 bit in a virtual machine, the host system is windows 10 64 bit. This is my launch.json file:
{
"version": "0.2.0",
"configurations": [
{
"name": "C++ Launch",
"type": "cppdbg",
"request": "launch",
"program": "/usr/bin/gdb",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"environment": [],
"externalConsole": true,
"linux": {
"MIMode": "gdb"
},
"osx": {
"MIMode": "lldb"
},
"windows": {
"MIMode": "gdb"
}
},
{
"name": "C++ Attach",
"type": "cppdbg",
"request": "attach",
"program": "/usr/bin/gdb",
"processId": "${command.pickProcess}",
"linux": {
"MIMode": "gdb"
},
"osx": {
"MIMode": "lldb"
},
"windows": {
"MIMode": "gdb"
}
}
]
}
As you can see, I set the program to gdb. Now if i try to debug my code with "C++ Launch" the terminal window for the gdb debugger will open, and the VSCode window looks like it is in debug mode.
Shortly before my Virtual machine crashes
Then my Virtual Machine just crashes, without any error message. My virtual machine client says canceled. I looked into every logfile that seemed at least a little relevant. I checked the virtual machine log. I google this problem in various ways. I checked if it crashes even if I close gdb before the crash (it does). And still I haven't found a way to prevent this crash from happening.
I asked most of my co-workers and they don't know an answer either.
This is my first post/question, if I made any mistakes (format, formulation, etc.) please tell me, so the next time I want to ask something it will be better.
Thanks in advance.

Node package manager keeps on loading in installing package depenencies

I am studying node js and I created a package.json like this:
{
"name": "NodeExpress",
"version": "0.1.0",
"description": "My Simple Express",
"main": "app.js",
"author": {
"name": "My Name",
"email": "name#email.com"
},
"dependencies": {
"express": "*",
"jade": "*",
}
}
When I checked my node_modules it has all the dependencies I need but in my console it's just loading. What does it mean? Is it still downloading?
When I checked the time it is almost 20 minutes past away since I install the dependencies.
Is it fine if I stop the execution of node packager installer?

Node NPM unable to require package by name only path

I created a new Node Package to start sharing a project that I'm working on, but I'm having a bit of trouble getting my require statement to work.
Project: https://github.com/kcjonson/indigo
The issue that I'm having is that requiring my module this way:
var indigo = require('indigo');
Does not work, but requiring it by more explicit path like:
var indigo = require('indigo/lib/indigo');
works just fine.
I assume this is an issue with my package.json file which is as follows:
{
"author": {
"name": "Kevin Jonson",
"email": "kcjonson#gmail.com",
"url": "http://kevinjonson.com"
},
"name": "indigo",
"description": "Node.js Facade for Perceptive Home Automations Indigo home automation servers python REST API",
"version": "0.0.7",
"repository": {
"type": "git",
"url": "git://github.com/kcjonson/indigo.git" },
"directories": {
"lib": "./lib"
},
"main:": "lib/indigo.js",
"license": "MIT",
"private": false
}
I've successfully added it to NPM and running npm install on the project that is using it does download the correct latest version and places it in the node_modules directory as expected.
Any help would be appreciated, thanks in advance.
I am not sure if that is going to work but still worth a try I guess.
Try removing 'directories'