Skip to content
This repository has been archived by the owner on Jan 23, 2025. It is now read-only.

Commit

Permalink
fixing bug that allowed limits of more than 100 records to be retriev…
Browse files Browse the repository at this point in the history
…ed by the get top members api
  • Loading branch information
mdesiderio committed Sep 28, 2016
1 parent 2598a5a commit 2236bae
Show file tree
Hide file tree
Showing 10 changed files with 129 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ test/tmp/design_tmp_submissions/*.zip
test/tmp/memberPhoto/*
.idea
.settings
**/jdk-8u51-linux-x64.gz
Binary file added actions/.challengeTypes.js.swp
Binary file not shown.
Binary file added actions/.challenges.js.swp
Binary file not shown.
3 changes: 0 additions & 3 deletions actions/tops.js
Original file line number Diff line number Diff line change
Expand Up @@ -560,9 +560,6 @@ exports.getTopTrackMembers = {
sqlParams.firstRowIndex = (pageIndex - 1) * pageSize;
sqlParams.pageSize = pageSize;

if (trackType === "data") {
sqlParams.pageSize = 2 * pageIndex * pageSize;
}
// Retrieves paged and ordered top members for the given track.
api.dataAccess.executeQuery('get_top_members_' + trackType, sqlParams, dbConnectionMap, cb);
}, function (rows, cb) {
Expand Down
Binary file added deploy/.env.sh.swp
Binary file not shown.
Binary file added initializers/.dataAccess.js.swp
Binary file not shown.
13 changes: 11 additions & 2 deletions local/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
version: '2'
services:
informix:
image: appiriodevops/informix:1.2
ports:
- 2021:2021
tc-api:
image: "node"
build: ./node
depends_on:
- informix
ports:
- "7777:7777"
- "8080:8080"
volumes:
- ../:/tc-api
command: /bin/bash -c "cd /tc-api && npm install && source local/env.sh && npm start && tail -f log/forever.log"
100 changes: 100 additions & 0 deletions local/env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
#!/bin/bash

#
# Copyright (C) 2013-2014 TopCoder Inc., All Rights Reserved.
#
# Version: 1.3
# Author: vangavroche, isv, TCASSEMBLER
# changes in 1.1:
# - add JIRA_USERNAME and JIRA_PASSWORD
# changes in 1.2:
# - added RESET_PASSWORD_TOKEN_CACHE_EXPIRY environment variable
# - added RESET_PASSWORD_TOKEN_EMAIL_SUBJECT environment variable
# - added REDIS_HOST environment variable
# - added REDIS_PORT environment variable
# changes in 1.3
# - added WKHTMLTOIMAGE_COMMAND_PATH environment variable
# - added WKHTMLTOIMAGE_IMAGE_WIDTH environment variable
# - added HIGHLIGHT_STYLE_LINK environment variable
#

# tests rely on caching being off. But set this to a real value (or remove) while coding.
export CACHE_EXPIRY=-1

VM_IP=informix
if [ -n "$TC_VM_IP" ]
then
VM_IP=$TC_VM_IP
fi

export TC_DB_NAME=informixoltp_tcp
export TC_DB_HOST=$VM_IP
export TC_DB_PORT=2021
export TC_DB_USER=informix
export TC_DB_PASSWORD=1nf0rm1x

export TC_DW_NAME=informixoltp_tcp
export TC_DW_HOST=$VM_IP
export TC_DW_PORT=2021
export TC_DW_USER=informix
export TC_DW_PASSWORD=1nf0rm1x

# oauth provider
export TC_API_HOST=api.topcoder.com

# LDAP settings
export TC_LDAP_HOST=$VM_IP
export TC_LDAP_PORT=636
export TC_LDAP_PASSWORD=secret
export TC_LDAP_MEMBER_BASE_DN="ou=members, dc=topcoder, dc=com"
export TC_BIND_DN="cn=Manager,dc=topcoder,dc=com"

# Mail settings
export TC_EMAIL_HOST=smtp.gmail.com
export TC_EMAIL_HOST_PORT=465
export TC_EMAIL_SECURED=true
export [email protected]
export TC_EMAIL_PASSWORD=tc_public_email
export [email protected]
export TC_EMAIL_TEMPLATE_DIR=mail_templates

export TC_ACTIVATION_SERVER_NAME="https://www.topcoder.com"
export TC_SOFTWARE_SERVER_NAME="https://software.topcoder.com"
export TC_FORUMS_SERVER_NAME="http://apps.topcoder.com/forums"

export PASSWORD_HASH_KEY="ciTHHTSMg6ixffIuPbB30A=="
## JDBC connection pool environment variables - set for all databases
export MINPOOL=1
export MAXPOOL=20
export MAXSIZE=0
export IDLETIMEOUT=3600
export TIMEOUT=30000

# Used in Jira soap service (Bugs API)
export JIRA_USERNAME=api_test
export JIRA_PASSWORD=8CDDp6BHLtUeUdD

# Forum settings
export STUDIO_FORUMS_SERVER_NAME="http://studio.topcoder.com/forums"
export GRANT_FORUM_ACCESS=false
export DEV_FORUM_JNDI=jnp://env.topcoder.com:1199

## The period for expiring the generated tokens for password resetting
export RESET_PASSWORD_TOKEN_EMAIL_SUBJECT=TopCoder Account Password Reset
# Set this to 180000 which is 3 mins. This will help saving time for test.
export RESET_PASSWORD_TOKEN_CACHE_EXPIRY=180000

export REDIS_HOST=localhost
export REDIS_PORT=6379

export DEVELOP_SUBMISSION_MAX_SIZE=6144

export WATERMARK_FILE_PATH=test/test_files/design_image_file_generator/studio_logo_watermark.png

export WKHTMLTOIMAGE_COMMAND_PATH=/home/ubuntu/tmp/wkhtmltox-0.12.1/static-build/posix-local/wkhtmltox-0.12.1/bin/wkhtmltoimage
export WKHTMLTOIMAGE_IMAGE_WIDTH=1024
export HIGHLIGHT_STYLE_LINK=http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/styles/%OVERRIDE_STYLE_NAME%.min.css

export JWT_TOKEN_COOKIE_KEY="tcjwt_vm"

export ADMIN_API_KEY=1234567
15 changes: 15 additions & 0 deletions local/node/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:0.10

COPY jdk-8u51-linux-x64.gz /opt

RUN cd /opt && \
tar -xvf jdk-8u51-linux-x64.gz && \
cd /usr/bin && \
ln -s /opt/jdk1.8.0_51/bin/java java && \
ln -s /opt/jdk1.8.0_51/bin/javac javac

ENV JAVA_HOME=/opt/jdk1.8.0_51

RUN npm install -g java

RUN apt-get install -y net-tools psmisc
3 changes: 2 additions & 1 deletion queries/get_top_members_data
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
SELECT
FIRST @pageSize@
SKIP @firstRowIndex@
FIRST @pageSize@
c.coder_id AS user_id
, handle
, rating
Expand Down

0 comments on commit 2236bae

Please sign in to comment.