-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #99 from open-template-hub/develop
Release/mq
- Loading branch information
Showing
23 changed files
with
546 additions
and
604 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
version: 2 | ||
|
||
updates: | ||
- package-ecosystem: 'npm' | ||
directory: '/' | ||
schedule: | ||
interval: 'weekly' | ||
day: 'monday' | ||
time: '08:00' | ||
timezone: 'Etc/GMT' | ||
target-branch: 'workflow/dependency-update' | ||
labels: | ||
- 'workflow' | ||
milestone: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Cron Dependency Checker Workflow | ||
|
||
on: | ||
schedule: | ||
- cron: '0 4 * * 1' | ||
|
||
jobs: | ||
cron-dependency-checker: | ||
name: 'Cron Dependency Checker' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v2 | ||
with: | ||
token: ${{ secrets.MASTER_BRANCH_ACCESS_TOKEN }} | ||
|
||
- name: Install Node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12 | ||
|
||
- name: NPM Install | ||
run: npm i | ||
- name: Npm Outdated | ||
run: npm run outdated | ||
- name: Build | ||
run: npm run buildProd | ||
|
||
- name: Git Commit and Push | ||
run: | | ||
git config --global user.email "furknyavuz@gmail.com" | ||
git config --global user.name "Furkan Yavuz" | ||
git commit -am "Workflow/dependency check" | ||
git push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<component name="ProjectRunConfigurationManager"> | ||
<configuration default="false" name="env" type="ShConfigurationType"> | ||
<option name="SCRIPT_TEXT" value="" /> | ||
<option name="INDEPENDENT_SCRIPT_PATH" value="true" /> | ||
<option name="SCRIPT_PATH" value="$PROJECT_DIR$/env.sh" /> | ||
<option name="SCRIPT_OPTIONS" value="" /> | ||
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" /> | ||
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" /> | ||
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" /> | ||
<option name="INTERPRETER_PATH" value="/bin/bash" /> | ||
<option name="INTERPRETER_OPTIONS" value="" /> | ||
<option name="EXECUTE_IN_TERMINAL" value="true" /> | ||
<option name="EXECUTE_SCRIPT_FILE" value="true" /> | ||
<envs /> | ||
<method v="2" /> | ||
</configuration> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<component name="ProjectRunConfigurationManager"> | ||
<configuration default="false" name="outdated" type="js.build_tools.npm"> | ||
<package-json value="$PROJECT_DIR$/package.json" /> | ||
<command value="outdated" /> | ||
<node-interpreter value="project" /> | ||
<envs /> | ||
<method v="2" /> | ||
</configuration> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<component name="ProjectRunConfigurationManager"> | ||
<configuration default="false" name="update" type="js.build_tools.npm"> | ||
<package-json value="$PROJECT_DIR$/package.json" /> | ||
<command value="update" /> | ||
<node-interpreter value="project" /> | ||
<envs /> | ||
<method v="2" /> | ||
</configuration> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { AuthActionType } from '@open-template-hub/common'; | ||
|
||
export class AuthQueueConsumer { | ||
constructor(private channel: any) {} | ||
|
||
onMessage = async (msg: any) => { | ||
if (msg !== null) { | ||
const msgStr = msg.content.toString(); | ||
const msgObj = JSON.parse(msgStr); | ||
|
||
const message: AuthActionType = msgObj.message; | ||
|
||
// Decide requeue in the error handling | ||
let requeue = false; | ||
|
||
if (message.example) { | ||
var exampleHook = async () => { | ||
console.log('Auth server example'); | ||
}; | ||
|
||
await this.operate(msg, msgObj, requeue, exampleHook); | ||
} else { | ||
console.log('Message will be rejected: ', msgObj); | ||
this.channel.reject(msg, false); | ||
} | ||
} | ||
}; | ||
|
||
private operate = async ( | ||
msg: any, | ||
msgObj: any, | ||
requeue: boolean, | ||
hook: Function | ||
) => { | ||
try { | ||
console.log( | ||
'Message Received with deliveryTag: ' + msg.fields.deliveryTag, | ||
msgObj | ||
); | ||
await hook(); | ||
await this.channel.ack(msg); | ||
console.log( | ||
'Message Processed with deliveryTag: ' + msg.fields.deliveryTag, | ||
msgObj | ||
); | ||
} catch (e) { | ||
console.log( | ||
'Error with processing deliveryTag: ' + msg.fields.deliveryTag, | ||
msgObj, | ||
e | ||
); | ||
|
||
this.channel.nack(msg, false, requeue); | ||
} | ||
}; | ||
} |
Oops, something went wrong.